Page 1 of 1

signed 16 bit tiff is not read correctly

Posted: 2015-03-26T08:44:17-07:00
by romainFr
I have 16 bit signed integer grayscale microscopy images (that are displayed correctly in ImageJ), that appear black and white in display -- or in any program downstream of imagemagick.

Identify reports a 16bit image, but uncorrectly gives a min value of 0 and a max of 65535 (I can check the correct values in ImageJ and there usually in the -100 to 5000 range).

Is it normal (meaning are signed 16 bit images unsupported ?) ? If not I can send a sample image to help solving the problem.

I'm running ImageMagick 6.9.1-0 in Ubuntu 14.04.

Thanks !

Re: signed 16 bit tiff is not read correctly

Posted: 2015-03-26T10:18:43-07:00
by magick
Post a URL to one of your images so we can download it and inspect it. We'll get back to you once we've viewed the image.

Re: signed 16 bit tiff is not read correctly

Posted: 2015-03-26T10:30:10-07:00
by romainFr
Here is an example :
https://www.dropbox.com/s/nm3bcypdiw0y38w/test.tif?dl=0

By looking at the histogram, it seems it has the correct number of values, but they're not interpreted correctly (they all fall in the 0-3% or 98-100% range).

Thanks !

Re: signed 16 bit tiff is not read correctly

Posted: 2015-03-26T13:29:40-07:00
by magick
Most of the infra-structure is in-place to support 16-bit signed pixels in ImageMagick, but not quite. For negative values, we have the HDRI-enabled version of ImageMagick but we also need to treat the 16-bit pixels as signed rather than unsigned. We'll get a patch in to fix the problem, but currently we do not have an ETA on when we'll have the patch. In the mean-time, you should be able build an HDRI version of ImageMagck then use the -evaluate or -fx option to convert the unsigned pixels to signed.

Re: signed 16 bit tiff is not read correctly

Posted: 2015-03-26T14:48:50-07:00
by romainFr
Thanks a lot for your answer. The work-around works nicely.

Re: signed 16 bit tiff is not read correctly

Posted: 2015-03-26T17:21:05-07:00
by magick
Can you post the command-line you used to generate the correct results? With it we can generate a reference image to ensure our patch works correctly. Thanks.