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

Image read wrongly turns out mostly black #38

Open
THausherr opened this issue Apr 14, 2022 · 1 comment
Open

Image read wrongly turns out mostly black #38

THausherr opened this issue Apr 14, 2022 · 1 comment

Comments

@THausherr
Copy link

THausherr commented Apr 14, 2022

x.zip

Reading this file with ImageIO.read() and writing it with ImageIO.write() wrongly brings a visually black image. IrfanView claims it has 947 unique colors. IrfanView correctly displays the source image, and claims it has 12 BitsPerPixel.

Using the example "How to read a JP2 or JPX image" at https://github.com/faceless2/jpeg2000/ creates a correct .ppm image; iin.getBitsPerComponent() returns 8. So maybe they fixed that bug some time ago.

Source of that image: https://bugzilla.mozilla.org/show_bug.cgi?id=1659412

@THausherr
Copy link
Author

I had another look, I think that the problem is that the 3x4bit values aren't scaled up to 2x8bit values when the BufferedImage is created.

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

No branches or pull requests

1 participant