-
-
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
Image.Open() and 16bit gray images - int32 output #3041
Labels
Comments
There's better support for image operations on int32 images than int16, especially for signed 16 bit images. |
Is there any change this issue can be revisited? AFAICT Pillow's TIFF and JPEG handlers, for example, will happily open 16-bit data without upcasting, so I don't see why the PNG handler can't do the same. |
anntzer
added a commit
to anntzer/matplotlib
that referenced
this issue
Sep 4, 2019
The version check in _has_pil (pillow>=3.4) was dropped as the oldest Pillow that supports Py3.6 (the oldest Python supported by Matplotlib) is 4.0 anyways. - PIL returns uint16 images as int32 (python-pillow/Pillow#3041); we could adopt imageio's dtype correcting code if desired.
anntzer
added a commit
to anntzer/matplotlib
that referenced
this issue
Sep 4, 2019
The version check in _has_pil (pillow>=3.4) was dropped as the oldest Pillow that supports Py3.6 (the oldest Python supported by Matplotlib) is 4.0 anyways. - PIL returns uint16 images as int32 (python-pillow/Pillow#3041); we could adopt imageio's dtype correcting code if desired.
This has been revisited in the form of #3796 |
I've created PR #7849 to address this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use Image.Open("test.png") on a uint16 png depth image
-> Pillow opens is with the mode "I" which is int32.
I'm wondering if this behaviour is intentional?
I guess there is no information loss involved - but why would you do this conversion to int32 instead
of the uint16?
Thanks!
The text was updated successfully, but these errors were encountered: