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.show() problem with I;16 mode TIFFs #4729
Comments
If you compress your original image into a zip or tgz, then you should be able to upload it. |
I'm pretty sure it's because the default conversions are using the 0-255 range of the i;16 and clipping the rest to 255. |
I'm not allowed to share it. The generated example is enough to reproduce and analyze the error, isn't it?
When generating the example picture (code above) I used higher number than 255 for the intensitiy (instead of now 70). They all produced blank white images. Makes sense regarding your explanation. |
Note that #4080 was merged and released in 7.1.0, meaning that Line 62 in 4f61456
This is likely no longer necessary, since PNG supports I;16 mode, as well as most (if not all) others. |
What did you do?
Loaded a 16 bit integer TIFF file and showed it.
What did you expect to happen?
That the image looks exactly the same as when opened manually.
What actually happened?
It looked very different.
I can't share the original image I am working with, but it becomes almost completely white, whereas it was mostly black before.
I generated another example (code below). I can't upload it here, because GitHub doesn't accept .tif.
The black one on the left side is the actual correct one opened manually.
The problem might be the temporary conversion to BMP. (Uneducated guess)
What are your OS, Python and Pillow versions?
EDIT:
test_generated.zip
The text was updated successfully, but these errors were encountered: