dbmdz/imageio-jnr

16bit jp2 wrong BufferedImage Type

Closed this issue · 2 comments

when i try to read in the "gray16bitWithoutAlpha.jp2" example image it gets read in as an 8bit grayscale image instead of a 16bit one.

this can be determined by the buffer image type which should be TYPE_USHORT_GRAY (11), but is TYPE_BYTE_GRAY (10)see.

i have forked the project and replaced "gray16bitWithoutAlpha.png" with an actual 16bit png, which causes the test "testReadGray16bitWithoutAlpha" to fail.

I have created a fix.

I noticed that this behavior (16bit -> 8bit) seems to be intended.

are there particular reasons for that?

Resolved with merger of #201