-
-
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
PNG opens as I rather than I;16 #3796
Comments
I encountered this issue as well not very long ago. Is there any workaround in the meantime to "force" reading as |
Note that this is a duplicate of #3041 |
Because Pillow doesn't scale images during conversion (#3159), you should just be able to convert the image. from PIL import Image
im = Image.open("Tests/images/16_bit_binary_pgm.png")
assert im.mode == "I"
assert im.getpixel((0, 0)) == 65535
assert im.convert("I;16").getpixel((0, 0)) == 65535 |
Just wanted to note that this is still an issue as of Pillow |
16-bit grayscale TIFF files are opened as |
Individual plugins set the modes that images are opened in. If you're asking why the code is behaving this why, it is because of Pillow/src/PIL/PngImagePlugin.py Line 65 in 2bd5426
|
I've created PR #7849 to resolve this. |
@radarhere I confirmed that 10.3.0 fixed this issue for us. Thanks! |
What did you do?
Open a 16-bit grayscale png and access its
mode
flag.What did you expect to happen?
im.mode == 'I;16'
What actually happened?
im.mode == 'I'
What are your OS, Python and Pillow versions?
> file foo.png foo.png: PNG image data, 32 x 32, 16-bit grayscale, non-interlaced
The text was updated successfully, but these errors were encountered: