py draw matrix of black square and white circle

Solutions on MaxInterview for py draw matrix of black square and white circle by the best coders in the world

showing results for - "py draw matrix of black square and white circle"
Ryan
31 Sep 2020
1>>> face_memmap = np.memmap('face.raw', dtype=np.uint8, shape=(768, 1024, 3))
2
María
13 Feb 2017
1>>> from scipy import misc
2>>> import imageio
3>>> face = misc.face()
4>>> imageio.imsave('face.png', face) # First we need to create the PNG file
5
6>>> face = imageio.imread('face.png')
7>>> type(face)      
8<class 'imageio.core.util.Array'>
9>>> face.shape, face.dtype
10((768, 1024, 3), dtype('uint8'))
11
Amir
21 Mar 2018
1>>> face.tofile('face.raw') # Create raw file
2>>> face_from_raw = np.fromfile('face.raw', dtype=np.uint8)
3>>> face_from_raw.shape
4(2359296,)
5>>> face_from_raw.shape = (768, 1024, 3)
6
similar questions