Login  Register

12- and 14-bit PNGs in imageJ

Posted by Nathaniel Cunningham on Feb 09, 2009; 10:27pm
URL: http://imagej.273.s1.nabble.com/12-and-14-bit-PNGs-in-imageJ-tp3693766.html

I have some 12-bit and 14-bit PNG images (generated in LabVIEW).  When
opened in imageJ, they are read in as 16-bit images (expected), but their
values are incorrect.  Examining some of the values, and comparing with the
correct values for those pixels, I find that the first 2 (first 4) bits of
the 14-bit (12-bit) values are being repeated, in order to generate the
16-bit values.  (Perhaps the extra bits are actually being taken from
adjacent pixels) E.g.:

the 12-bit value 262
000100000110
is read by imageJ as the 16-bit value 4193
0001000001100001

and the 14-bit value 10356
10100001110100
is read as the 16-bit value 41426
1010000111010010

I am able to read these same images in correctly with IDL.  Is there a way
to ensure that ImageJ also reads them properly?  Might there be something
wrong with my PNG images themselves?  I've posted one example at the link
below:
The file '14-bit_example.png' (345 KB) is available for download at
http://dropbox.unl.edu/uploads/20090216/025c949ee3bfe378/14-bit_example.png
for the next 7 days.

Thanks for any help.
--Nathaniel