HOME/Articles/

pil example pillow mask (snippet)

Article Outline

Python pil example 'pillow mask'

python pillow mask

Python pil example: pillow mask

from PIL import Image

col = Image.open('myimage.jpg')
gry = col.convert('L')
grarray = np.asarray(gry)
bw = (grarray > grarray.mean())*255
imshow(bw)