Getting “cannot write mode P as JPEG” while operating on JPG image

You need to convert the image to RGB mode.

Image.open('old.jpeg').convert('RGB').save('new.jpeg')

Leave a Comment