|AWARE [SYSTEMS]||Imaging expertise for the Delphi developer|
|TIFF and LibTiff Mailing List Archive|
LibTiff Mailing List
2011.03.22 04:01 "Re: Lab based colormaps", by Steve Underwood
On 03/22/2011 11:29 AM, Bob Friesenhahn wrote: > On Tue, 22 Mar 2011, Steve Underwood wrote: >> >> If I use libtiff to read the colormap it gives me three arrays, each 256 >> elements long, just as would happen for an RGB colour map. If I try to >> interpret these as the L, a, and b arrays, I get crazy colours. If, >> however, I reorder the data as if the TIFF file contains the colour >> table in the order L, a, b, L, a, b, etc. the >> resulting image looks OK. I can't see in the TIFF spec, or the extension >> specs, where the order of Lab colormap data is defined. However, it >> would seem bizarre if it is not in the same order as RGB data. >> >> Has anyone had similar experiences? The test files are supposed to have >> been used for interworking tests with several FAX makers, so I would >> have expected anything as blatantly wrong as this to have been caught >> and fixed. > > What does 'tiffinfo' say for one of these files? Are these files > available for download from somewhere? > > Bob You can find these test files in several place on the internet, one of which is http://www.itu.int/itudoc/itu-t/com16/tiff-fx/t-cases/index.html. As far as I am aware there is only one revision of these files. The following is the tiffinfo report for the first page in this file: TIFFReadDirectory: Warning, /home/steveu/telephony/TIFF-FX/l04x_02x.tif: unknown field with tag 346 (0x15a) encountered. TIFFReadDirectory: Warning, /home/steveu/telephony/TIFF-FX/l04x_02x.tif: unknown field with tag 400 (0x190) encountered. TIFF Directory at offset 0x8 (8) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2342 Resolution: 200, 200 pixels/inch Bits/Sample: 8 Compression Scheme: 10 (0xa) Photometric Interpretation: 10 (0xa) FillOrder: msb-to-lsb Samples/Pixel: 1 Rows/Strip: 2342 Planar Configuration: single image plane Page Number: 0-2 Color Map: (present) DocumentName: Test case L4 ImageDescription: Page 1: Color test chart Page 2: Bar chart Software: Xerox TIFF-FX Reference Implementation Mon Feb 08 08:58:02 PM 99 Tag 346: 1 Tag 400: 1946 Tag 346 says its a color-map indexed image. Tag 400 is TIFF-FX specific, and points to a global IFD. Compression scheme 10 is T.43. Photometric Interpretation 10 is ITULAB. tiffinfo doesn't display the contents of the colormap. However, comparing the 3 vectors libtiff returns with a hexdump of the file, libtiff is presenting the color-map in the same order it is stored in the file. This is correct, according the the TIFF V6.0 spec.