AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2001.02.21 18:05 "G4 colors (b/w or w/b ?)", by Chris Losinger
2001.02.21 18:52 "Re: G4 colors (b/w or w/b ?)", by Helge Blischke
2001.02.21 19:00 "Re: G4 colors (b/w or w/b ?)", by Chris Losinger
2001.02.21 19:13 "Re: G4 colors (b/w or w/b ?)", by Helge Blischke

2001.02.21 19:13 "Re: G4 colors (b/w or w/b ?)", by Helge Blischke

> -----Original Message-----
> From: Helge Blischke [mailto:H.Blischke@srz-berlin.de]
> Sent: Wednesday, February 21, 2001 1:53 PM
> To: Chris Losinger
> Cc: 'tiff@olympiakos.com'
> Subject: Re: G4 colors (b/w or w/b ?)

i'm having some trouble telling when a G4 TIFF is black on white vs. white on black. the images that are giving me trouble have these tags set:

        TIFFTAG_BITSPERSAMPLE = 1
        TIFFTAG_SAMPLESPERPIXEL = 1
        TIFFTAG_EXTRASAMPLES = 0
        TIFFTAG_PLANARCONFIG = 1
        TIFFTAG_PHOTOMETRIC = 1 (min = black)
        TIFFTAG_COMPRESSION = 4

TIFFReadRGBAImage reads them OK and so does my special g4 code, but the colors are reversed. Wang's Imaging stuff displays the images correctly.

so, i'm wondering, does anyone know what kind of magic Wang's stuff could be doing to get the colors right? someone here suggested maybe Wang is simply counting pixels and setting white to the color with the most pixels (since these are faxes).

Which app did create the image?

i don't know. the file came to me from a 3rd party.

Send me a sample file - it may be that the progometric

tag disagrees with the actual image data (I've seen this quite often).

        here it is.

LibTiff reads it as white text on black. Wang's viewer shows it as black on white (correctly)

        -c

>     ---------------------------------------------------------------

>                              Name: 0000002r.tif
>               Part 1.2       Type: TIFF Image (image/tiff)

>                          Encoding: base64

The file is OK; if I display it using my home-grown PostScript TIFF handler, it displays as

it should - black text on a white background.

But if I user libtiff's tiffcp to get an uncompressed image, the colours are exchanged.

So it clearly is a bug in libtiff.

Anyone to fix it?

Helge

--
H.Blischke@srz-berlin.de
H.Blischke@srz-berlin.com
H.Blischke@acm.org