convert image to grayscale pillow 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: pillow rgb to grayscale
Image.open(path).convert('LA')
from PIL import Image
img = Image.open("image.jpg")
img.convert("L").save("result.jpg")
Image.open(path).convert('LA')