Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

py draw matrix of black square and 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'))
Comment

py draw matrix of black square and 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)
Comment

py draw matrix of black square and white circle

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

PREVIOUS NEXT
Code Example
Python :: Select a Column in pandas data Frame Using Brackets 
Python :: python strong type 
Python :: pandas iat 0 
Python :: django create superuser with first_name 
Python :: reshaping a image vector/matrix 
Python :: /var/www/html/flag 
Python :: load python 
Python :: sklearn make iterator cv object 
Python :: Start Django Project At http://127.0.0.1:8080/ 
Python :: break statement python 
Python :: trigger to print on python 
Python :: How to create a python dictionary without defining values 
Python :: How to Use Sets to Remove Duplicate Items in Other Data Structures 
Python :: python os path join list 
Python :: get predict proba category order 
Python :: python module equal override 
Python :: python null check optional 
Python :: how to package a python library 
Python :: python denest list of anything 
Python :: How to swapcase of string in python 
Python :: awesome python 
Python :: assert isinstance python 
Python :: os cd python 
Python :: python recognize lower and upper case user input 
Python :: python using boolean len comparing with 
Python :: how can i add a list in python 
Python :: 90/360 
Python :: latex maths to python parser 
Python :: adjusted price in crsp pandas 
Python :: hidden semi markov model python from scratch 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =