how to convert a rgb image to grayscale in python 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: rgb to grayscale python
from PIL import Image
img = Image.open('image.png').convert('LA')
img.save('greyscale.png')