Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting "I" image to RGB issue #5642

Closed
Lucuz91 opened this issue Jul 28, 2021 · 2 comments
Closed

Converting "I" image to RGB issue #5642

Lucuz91 opened this issue Jul 28, 2021 · 2 comments

Comments

@Lucuz91
Copy link

Lucuz91 commented Jul 28, 2021

Hi all,

I am trying to convert a png image to a jpeg.
The image is opened in "I" mode, but when I convert to RGB and save it in jpeg the image is very different from the original.

  • OS: Ubuntu 20.04
  • Python: 3.8.5
  • Pillow: 8.3.1
from PIL import Image
img = Image.open('black_bands.png')
img2 = img.convert('RGB')
img2.save('black_bands_out.jpg')

Original image
black_bands

Converted image
black_bands_out

@radarhere
Copy link
Member

This is something of a known issue. #4044 found this converting to RGBA, and #3159 talks about this problem more generally.

@radarhere
Copy link
Member

Closing as part of #3159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants