Status: Read
Received: from phillip.thumbsplus.com by phillip.thumbsplus.com (NTMail 3.02.11) with ESMTP id pcrews for <pcrews@cerious.com>; Tue, 6 May 1997 05:39:19 -0400
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id CAA22472; Tue, 6 May 1997 02:24:27 -0700
	env-from (owner-tiff@sgi.engr.sgi.com)
Received: (from majordomo@localhost) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) id AAA06248 for tiff-list; Tue, 6 May 1997 00:30:09 -0700
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37]) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) via ESMTP id AAA06231 for <tiff-relay@relay.engr.sgi.com>; Tue, 6 May 1997 00:30:06 -0700
Received: from telos.fundesco.es (telos.fundesco.es [130.206.16.251]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id AAA08336
	for <tiff@sgi.com>; Tue, 6 May 1997 00:30:00 -0700
	env-from (ilopez@fundesco.es)
Received: from pc13.fundesco.es (pc230.fundesco.es [130.206.16.230])
          by telos.fundesco.es (8.8.4/8.8.4) with SMTP
	  id JAA09605; Tue, 6 May 1997 09:29:20 +0200 (MET DST)
Message-Id: <3.0.32.19970506092946.00693d3c@telos.fundesco.es>
X-Sender: ilopez@telos.fundesco.es
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Date: Tue, 06 May 1997 09:29:47 +0200
To: tiff@sgi.com
From: Inigo Lopez <ilopez@fundesco.es>
Subject: Re: I have a little problem with CCITT compression
Cc: gabriela_vaida@silanis.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Sender: owner-tiff@fddi-sgi.engr.sgi.com
Precedence: bulk

At 14:19 5/05/97 -0400, you wrote:
>Hi Silicon Graphics,
>
>My name is Gabriela Vaida and I'm using Libtiff version 3.4beta024 with
WINNT40.
>It's a really great job there, thanks for sharing it.
>But I'd like to know if it's my mistake or you know something about using
>CCITT compression. 
>I have this line in my code:
>TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4)
>which really compress the tiff image I'm creating, but my image has always
>the colors inverted after compression. It doesn't matter if I choose the
>photometric interpretation PHOTOMETRIC_MINISBLACK or PHOTOMETRIC_MINISWHITE
>(the second one it's normal for CCITT compression, I know!). If I don't want
>commpression (COMPRESSION_NONE)my tiff image has the colors I want - the
>problem is there only when using CCITT compression.

Hi Gabriela,

I happened to have a similar problem some time ago. Some TIFF viewers wrongly
assume that photometric interpretation for CCITT compressed images should be
MINISWHITE, and they don't even check the TIFF tag. For example, Imaging for
Windows by Wang (I guess these guys haven't read the TIFF spec!).

Anyway, you HAVE to set the photometric interpretation tag to the apropiate
value (it is MINISBLACK, right?) and use a correct TIFF viewer. But if you
want to use the same TIFF viewer, you will have to invert all the bits of your
image and set the tag to MINISWHITE before writing the image. This should
correct your problem and any viewer will display the image right.

This is what I do as I like the TIFF viewer developed by Wang, although I
HATE to invert the bits of all the images everytime I do a scan. It is such a
waste of time...

Iñigo

    O      Iñigo López Cía                 ilopez@fundesco.es
   o O     Fundesco - Dpto. Redes
  . o O    Plaza de la Independencia, 6    Tel: +34-1-3300735
   . o     28001 Madrid                    Fax: +34-1-3300675
    .      Spain

