jai-imageio/jai-imageio-jpeg2000

Image read wrongly turns out mostly black

Opened this issue · 1 comments

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

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.