2013.09.21 14:21 "Re: [Tiff] Convert 32 bits tiff to ascii array using LibTiff", by Bob Friesenhahn
I'm analyzing some synchrotron x-ray diffraction data which are in the form of either 16 or 32 bits .tiff images, signed or unsigned. Although the 16 bits images can be read using 'tiff2ps', for the 32 bits ones, I got the following error:
TIFFFetchNormalTag: Warning, ASCII value for tag "ImageDescription" contains null byte in value; value incorrectly truncated during reading due to implementation limitations.
The warning above is likely due to someone putting UTF-8 or UTF-16 into an ASCII text field.
BFO_11549.tif: Can not handle 32-bit/sample image.
LIBTIFF, Version 4.0.2
Copyright (c) 1988-1996 Sam Leffler
Copyright (c) 1991-1996 Silicon Graphics, Inc.
The error message seems to be indicating that Libtiff does not have support for 32 bits .tiff image, which I'm pretty sure is not the case, since
> Matlab uses the same Libtiff library ('imread' function) and everything seems to be working just fine.
Tiff2ps is not designed to handle 32-bit/sample images. Libtiff itself can handle such images.
The question is: How can I get the same output file (ascii matrix) from 32 bits tiff files? Also, since I'm using Linux OS (Ubuntu) and Fortran as coding language, I prefer something that is command-line based. Is that possible?
Postscript is unlikely to support 32-bit/sample images.
If you build GraphicsMagick from source code using configure option --with-quantum-depth=32 then your 32-bit unsigned TIFFs can be handled (and it can produce Postscript). GraphicsMagick built with lesser quantum depth can read such TIFFs but will discard depth resolution and the result might be unusable if the data is not full-range. GraphicsMagick is not likely to work correctly for signed integer images.
You really need a "remote sensing" or math-oriented imaging application to deal with 32-bit signed images.
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/