AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1997.02.12 16:37 "Photometric interp and CCIT Compression", by Ken Land
1997.02.12 19:02 "Re: Photometric interp and CCIT Compression", by Helge Blischke

1997.02.12 16:37 "Photometric interp and CCIT Compression", by Ken Land

Hi,

If you have a MIN_IS_BLACK image (say uncompressed) and run it through tiffcp to convert it to G4, the output file is incorrectly inverted.

Reading the resultant file with, somehow the actual image data has been converted to MIN_IS_WHITE but the photometric tag is still MIB.

On the flip side, if tifflib reads a CCITT compressed file the data is always handed over (from ReadScanLine()) as MIW data regardless of the photometric tag.

Is this behavior considerred correct? If some spec somewhere says that CCITT compressed data shall be MIW then so be it, but then tools like tiffcp (and all other tifflib based SW) must take this into account.

I notice that TIFFRGBAImageBegin() does account for this behavior in the latest libtif. (but not in previous versions of libtiff)

        switch (colorchannels) {
        case 1:
            if (isCCITTCompression(tif))
                img->photometric = PHOTOMETRIC_MINISWHITE;
            else
                img->photometric = PHOTOMETRIC_MINISBLACK;
            break;

I don't see any of this in the docs, what am I missing?

Thanks,

Ken