[Magick-bugs] 8bit tiff -- Change in Behavior / Bug : 8bit, 256color, PHOTOMETRIC_PALETTE == converted to 16-bit tiff
Scott Callaway
SCallaway at accelrys.com
Fri Aug 28 19:53:03 PDT 2009
Thank you for the additional details below.
The primary problem for my application is that the 8bit tiff gets converted to a 16bit image using the current version of ImageMagick.
The current versions of ImageJ and Gimp read this tiff as a 8bit image. Also, ImageMagick 6.3.6 read this tiff as a 8bit image.
I appears the code in coders/tiff.c [ near line 1000 ] is causing the pixels to be converted from 8bit to 16bit pixels. If ImageMagic code was modified so the pixels were kept at 8bits (as with ImageJ and Gimp), then this would also avoid the problem you outline below.
The image below that experiences this problem from an automated microscope that is used by many biologists and scientists [ this image is of fluorescent cell nuclei ]. Due to the quantitative nature of this work, it is important that pixel values are accurate.
http://www.huntermikic.com/imagemagick/imagemagick_AS_09047_050428030001_O01f00d0.TIF
Thank you for your efforts on this.
-----Original Message-----
From: duc.sequere.aut.de.via.decede at imagemagick.org [mailto:duc.sequere.aut.de.via.decede at imagemagick.org]
Sent: Friday, August 28, 2009 5:24 PM
To: magick-bugs at imagemagick.org; Scott Callaway
Subject: Re: [Magick-bugs] 8bit tiff -- Change in Behavior / Bug : 8bit, 256color, PHOTOMETRIC_PALETTE == converted to 16-bit tiff
> the max pixel is NOT 2^16 - the value is 65280 and not 65536.
Right. Your image includes a colormap and the maximum value in the colormap
is 65280.
tiffdump -m 256 image.tif
Colormap (320) SHORT (3) 768<0 256 512 768 1024 1280 1536 ...
62720 62976 63232 63488 63744 64000 64256 64512 64768 65024 65280>
The TIFF library includes this 16-bit to 8-bit conversion:
#define CVT(x) (((x) * 255) / ((1L<<16)-1))
Therefore CVT(65280) is 254, not 255 as you had suggested.
More information about the Magick-bugs
mailing list