How to convert picture in grayscale in Python Pillow

Converting an image to black and white in Python is easy with Pillow library

An example: 

from PIL import Image

img=Image.open('test.jpg')
greyscaleImg = img.convert('L')
greyscaleImg.show()

where 'test.jpg' - is a path to your image

Comments

No comments yet, you can leave yours: