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

PSD incorrectly loaded #6387

Closed
gverm opened this issue Jun 20, 2022 · 3 comments · Fixed by #6481
Closed

PSD incorrectly loaded #6387

gverm opened this issue Jun 20, 2022 · 3 comments · Fixed by #6481

Comments

@gverm
Copy link

gverm commented Jun 20, 2022

What did you do?

I opened the TIFF in Pillow and converted it to JPG.

What did you expect to happen?

The JPG image to look the same as the original TIFF.

What actually happened?

The converted JPG looks malformed and has messed up colors.

What are your OS, Python and Pillow versions?

  • OS: Linux
  • Python: 3.10.5
  • Pillow: 9.1.1 (also tested -git)
>>> img = Image.open("3662b8bd397337482862ab1a06bf3366-OA_535_161_17_F_TE.tif")
>>> out_img = img.convert("RGB")
>>> out_img.save("converted.jpg", quality=95)

original image (beware, 274MB)
converted image

Is it okay to report this here or should I report this to the appropriate library (libtiff, jpeg-turbo, ?)

@radarhere radarhere added TIFF and removed TIFF labels Jun 21, 2022
@radarhere
Copy link
Member

Here is the right place to report it - taking a look, your file is actually not a TIFF, but a Photoshop file. The fact that we're not loading it correctly has nothing to do with those other libraries.

@radarhere radarhere changed the title TIFF is incorrectly converted to JPG PSD incorrectly loaded Jun 21, 2022
@gverm
Copy link
Author

gverm commented Jun 21, 2022

@radarhere My bad, I should have checked the mimetype...

@radarhere
Copy link
Member

I've concluded that your PSD file has an alpha channel, and that Pillow isn't correctly handling RGBA PSD files.

I've created PR #6481 to resolve this.

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

Successfully merging a pull request may close this issue.

2 participants