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

2004.12.18 17:44 "Re: [Tiff] Q: Fax photometric", by Bob Friesenhahn

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).

There is a choice between doing what the specification says should be done and the most common usage. It seems that these popular applications always assume the normal case. They may do this because some TIFF files are created with the wrong setting and users complain.

I believe that current GraphicsMagick behaves similarly to libtiff.

Bob

======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen