signed 16 bit tiff is not read correctly

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
romainFr
Posts: 3
Joined: 2015-03-26T07:54:02-07:00
Authentication code: 6789

signed 16 bit tiff is not read correctly

Post 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 !
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: signed 16 bit tiff is not read correctly

Post 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.
romainFr
Posts: 3
Joined: 2015-03-26T07:54:02-07:00
Authentication code: 6789

Re: signed 16 bit tiff is not read correctly

Post 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 !
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: signed 16 bit tiff is not read correctly

Post 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.
romainFr
Posts: 3
Joined: 2015-03-26T07:54:02-07:00
Authentication code: 6789

Re: signed 16 bit tiff is not read correctly

Post by romainFr »

Thanks a lot for your answer. The work-around works nicely.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: signed 16 bit tiff is not read correctly

Post 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.
Post Reply