DEV Community

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

Convert Color Photo to Black & White in Python

soniarpit profile image CodeSnail 🐌 ・1 min read
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 :)

Discussion (0)

pic
Editor guide