Return-Path: owner-tiff@olympiakos.com
Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id g2PMRP7r026347
	for <dron@localhost>; Tue, 26 Mar 2002 01:28:10 +0300
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.9.0)
	for dron@localhost (single-drop); Tue, 26 Mar 2002 01:28:10 +0300 (MSK)
Received: from gate7.olympiakos.com ([64.32.199.150]) by shared1-mail.whowhere.com; Mon Mar 25 10:58:55 2002
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id NAA13455;
	Mon, 25 Mar 2002 13:42:52 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Mon, 25 Mar 2002 13:38:54 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id NAA13411
	for tiff-outgoing; Mon, 25 Mar 2002 13:38:54 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from arcticus.com ([66.7.173.250])
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id NAA13408
	for <tiff@olympiakos.com>; Mon, 25 Mar 2002 13:38:51 -0500
Received: (qmail 26037 invoked by uid 0); 25 Mar 2002 11:32:32 -0000
Received: from unknown (HELO 3dnature.com) (192.168.2.11)
  by 0 with SMTP; 25 Mar 2002 11:32:32 -0000
Message-ID: <3C9F6E66.5080901@3dnature.com>
Date: Mon, 25 Mar 2002 11:37:26 -0700
From: "Chris 'Xenon' Hanson" <xenon@3dnature.com>
Reply-To: xenon@3dnature.com
Organization: Arcticus
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2
X-Accept-Language: en-us
MIME-Version: 1.0
To: tiff@olympiakos.com
Subject: Photoshop TIFF+Alpha mysteries
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 2949
Lines: 62

   Maybe this is an FAQ.

   We use LIBTIFF in our software, and I am forever grateful for the brain
aneurysms it has prevented for me.

   In several places in our software we support the use of an Alpha channel
to indicate transparency amounts when compositing various images together.

   For example, I use Photoshop 5.5 to open a vector-based logo file I have
lying around. I set RGB Color, and anti-aliased. It converts it to a raster
image with transparency (but no Alpha channel). Fine.

   Now, I do Select/Load Selection, choose Layer 1 Transparency and New
Selection. Now, Select/Save Selection, New Channel, named "Alpha". Now
I flatten the image.

   Ok. I appear to have an Alpha channel. Here I can do one of two things.

   I can save it as a 32-bit Targa file or I can save it as a TIFF file.

   If I save it as Targa, it works fine in my app. The NULL areas where there
was no logo are interpreted as transparent.

   If I save it as TIFF, it doesn't exactly work. The areas that are
transparent in the TGA are opaque. A few pixels along the border between
the logo and the background area appear to become transparent.

   Loading the working TGA file back into Photoshop and resaving it as a TIFF
appears to make a similarly non-working TIFF. Resaving the non-working TIFF
as a 32-bit TGA makes a working TGA file.

   So, the actual Alpha 'channel' data in Photoshop is presumably identical
in all of the images. Perhaps Photoshop interprets that Alpha channel data
as it loads/saves to TIFF? Perhaps LIBTIFF is interpreting that Alpha channel
data differently as I load it? I'm not sure. All I know is that from the API
side of things, I have all indications that there is an alpha channel in the
TIFF image I load, yet when I go to use it in the way I am accustomed to, it
doesn't work the way i expect. I expect I'm missing some small detail.

   I've been thinking my next step is to add a a bit of debugging code to my
LIBTIFF loader to write the alpha channel out to a raw file so I may examine
it and see what exactly I'm getting out of LIBTIFF. However, I suspect this
is already a commonly-encountered problem and someone can just point me at
an answer I have overlooked.

   I considered that it might be an difference of premultipled versus non
premultipled alpha, but since the image data itself is the same, I can't see
how this could be.

   Thanks in advance for any advice. I still think LIBTIFF is the cat's meow,
and I'm very grateful for it's existence (and LIBGEOTIFF as well) because they
made my life much easier.

Chris - Xenon
-- 
  Chris Hanson | Xenon@3DNature.com | I've got friends in low latitudes!
        New Visual Nature Studio 1.1: http://www.3DNature.com/
  "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen


To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

