import pillow to grayscale code example
Example 1: python image to grayscale
from PIL import Image
img = Image.open("image.jpg")
img.convert("L").save("result.jpg")
Example 2: python pil to greyscale
#PIL image
img2 = img.convert('L')
from PIL import Image
img = Image.open("image.jpg")
img.convert("L").save("result.jpg")
#PIL image
img2 = img.convert('L')