“Py Draw Matrix of Black Square y White Circle” Código de respuesta

Py Draw Matrix of Black Square y White Circle

>>> face.tofile('face.raw') # Create raw file
>>> face_from_raw = np.fromfile('face.raw', dtype=np.uint8)
>>> face_from_raw.shape
(2359296,)
>>> face_from_raw.shape = (768, 1024, 3)
Yawning Yacare

Py Draw Matrix of Black Square y White Circle

>>> from scipy import misc
>>> import imageio
>>> face = misc.face()
>>> imageio.imsave('face.png', face) # First we need to create the PNG file

>>> face = imageio.imread('face.png')
>>> type(face)      
<class 'imageio.core.util.Array'>
>>> face.shape, face.dtype
((768, 1024, 3), dtype('uint8'))
Yawning Yacare

Py Draw Matrix of Black Square y White Circle

>>> face_memmap = np.memmap('face.raw', dtype=np.uint8, shape=(768, 1024, 3))
Yawning Yacare

Respuestas similares a “Py Draw Matrix of Black Square y White Circle”

Preguntas similares a “Py Draw Matrix of Black Square y White Circle”

Más respuestas relacionadas con “Py Draw Matrix of Black Square y White Circle” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código