AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.12.15 04:30 "[Tiff] Q: Fax photometric", by Chris Losinger
2004.12.15 04:34 "[Tiff] Q : CCITT - more", by Chris Losinger
2004.12.18 17:44 "Re: [Tiff] Q: Fax photometric", by Bob Friesenhahn
2004.12.18 18:40 "Re: [Tiff] Q: Fax photometric", by Joris Van Damme
2004.12.18 20:58 "RE: [Tiff] Q: Fax photometric", by Bill Bither
2004.12.18 23:13 "Re: [Tiff] Q: Fax photometric", by Joris Van Damme
2004.12.18 21:24 "Re: [Tiff] Q: Fax photometric", by Bob Friesenhahn

2004.12.15 04:30 "[Tiff] Q: Fax photometric", by Chris Losinger

I have an image that's CCITTRLE compressed, with a photometric tag = 1 (black=0)

the TIFF spec says:

The "normal" PhotometricInterpretation for bilevel CCITT compressed data is WhiteIsZero. In this case, the CCITT "white" runs are to be interpretated as white, and the CCITT "black" runs are to be interpreted as black. However, if the PhotometricInterpretation is BlackIsZero, the TIFF reader must reverse the meaning of white and black when displaying and printing the image.

so, according to the spec, this should be interpreted as black=0 -- photometric tag overrides CCITT default. but, if i do that, the image is clearly inverted (it's a fax, and the background should be white).

however, Photoshop 6 and 8, and MS Document Imaging all read it so that it looks right, white=0. LibTiff reads it 'inverted' (incorrect in appearance, but apparently correct according to the spec: black=0).

so, who's right? is there anything else about this image that says "white=0"?

TIFFDUMP:

fax45_inverted.tif:
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 46682 (0xb65a) next 0 (0)
SubFileType (254) LONG (4) 1 <0>
ImageWidth (256) LONG (4) 1 <1664>
ImageLength (257) LONG (4) 1 <2212>
BitsPerSample (258) SHORT (3) 1 <1>
Compression (259) SHORT (3) 1 <2>
Photometric (262) SHORT (3) 1 <1>
ImageDescription (270) ASCII (2) 103 <100 CHARACTERS ...>
StripOffsets (273) LONG (4) 57 <8 211 292 373 452 548 1823 3629 5625 6147 6615 71 39 7607 8117 8591 9090 9558 10084 11535 11901 12389 13341 14666 16228 ...>
SamplesPerPixel (277) SHORT (3) 1 <1>
RowsPerStrip (278) SHORT (3) 1 <39>
StripByteCounts (279) LONG (4) 57 <203 81 81 79 96 1275 1806 1996 522 468 524 468 510 474 499 468 526 1451 366 488 952 1325 1562 1444 ...>
XResolution (282) RATIONAL (5) 1 <200>
YResolution (283) RATIONAL (5) 1 <200>
ResolutionUnit (296) SHORT (3) 1 <2>
Software (305) ASCII (2) 36 <ImageLib by SkyLine Tool ...>
DateTime (306) ASCII (2) 20 <2004:07:30 14:16:13\0>
Artist (315) ASCII (2) 52 <50 CHARACTERS ...>
Copyright (33432) ASCII (2) 103 <100 CHARACTERS ...>

http://www.smalleranimals.com/images/fax45_inverted.tif

-c

----
Chris Losinger
losinger@earthlink.net
smallest@smalleranimals.com          http://www.smalleranimals.com