Login  Register

Re: 12- and 14-bit PNGs in imageJ

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

I used imagemagick's "convert" command to convert one of these PNGs to
TIFF.  The resulting TIFF has the wrong values -- whether read by ImageJ or
IDL.  I also read in one of the problematic PNGs with IDL, then saved the
resulting (correct) image array to a new PNG.  ImageJ reads the correct
values from this new file.

I conclude that the problem lies with the original PNG image file, which
apparently gives inconsistent results among image readers/viewers; I will
investigate further.

Thanks,
Nathaniel

On Tue, Feb 10, 2009 at 12:09 AM, Rasband Wayne <[hidden email]> wrote:

> Nathaniel,
>
> This is not something I can fix since ImageJ uses the javaIO  package to
> read PNGs. Can LabView save in TIFF format? If necessary, I can fix problems
> in ImageJ's TIFF reader.
>
> -wayne
>
>
>
> On Feb 9, 2009, at 5:27 PM, Nathaniel Cunningham wrote:
>
>  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
>>
>
>