-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Grayscale PNG image incorrectly converted to RGB #2574
Comments
So what's happening here is that the convert from 'I' to 'L' loses information, and the conversion isn't done is a particularly useful fashion. It's clamping the range of the 16bit image to 0-255, rather than (auto)scaling it. Unfortunately, I don't see a quick way to autorange the image so that it fits into the destination image format, but there's a workaround with imagemath. (any of the embedded functions that rely on histogram or lookup tables aren't going to work)
|
I'm going to call this "documented workaround" and close. |
This should be re-opened and fixed IMO. Or at least better documented. Digging into closed issues isn't intuitive. It took quite a while to find this fix. |
I have a PNG image which incorrectly converts to RGB mode. This is a grayscale 16-bit image, presumably created in Photoshop. When I open it with Pillow, mode of an image is described as
"I"
. I tried to convert it by calling:All I received was a white image with only black pixels rgb(0, 0, 0) copied from the original. I am using newest version of Pillow (4.1.1), problem appears both in Python 2.7 & 3.6.
I am attaching 2 files:
The text was updated successfully, but these errors were encountered: