DEV Community

Cover image for Convert Color Photo to Black & White in Python
Arpit
Arpit

Posted on

Convert Color Photo to Black & White in Python

from PIL import Image

img=Image.open("rdj.jpg")
contobw=img.convert("L")
contobw.save("rdj-bw.jpg")
contobw.show()
Enter fullscreen mode Exit fullscreen mode

Follow us :)

Top comments (0)