Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas013.isp.belgacom.be (localhost [127.0.0.1])
        by inav004.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id j8CJgpqf011159
        for <joris.at.lebbeke@skynet.be>; Mon, 12 Sep 2005 21:42:52 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx003.isp.belgacom.be (inmx003.isp.belgacom.be [195.238.3.11])
        by inas013.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id j8CJgj7j030431
        for <joris.at.lebbeke@skynet.be>; Mon, 12 Sep 2005 21:42:46 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx003.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j8CJgccd032064
        for <joris.at.lebbeke@skynet.be>; Mon, 12 Sep 2005 21:42:38 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j8CJc8sU006697;
	Mon, 12 Sep 2005 15:38:20 -0400
Received: from outmx026.isp.belgacom.be (outmx026.isp.belgacom.be
	[195.238.2.91])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j8CJc4pS006694
	for <tiff@lists.maptools.org>; Mon, 12 Sep 2005 15:38:04 -0400
Received: from outmx026.isp.belgacom.be (localhost [127.0.0.1])
	by outmx026.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id j8CJc27R014880
	for <tiff@lists.maptools.org>; Mon, 12 Sep 2005 21:38:02 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (184-149.246.81.adsl.skynet.be [81.246.149.184])
	by outmx026.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id j8CJbqig014785; Mon, 12 Sep 2005 21:37:52 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <003f01c5b7d1$85ae07b0$b895f651@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Hoan Chau" <Hoan.Chau@pointofview.com>,
        "TIFF mailing list" <tiff@lists.maptools.org>
References: <9FD334F55BC56E4C9BFA5CABC049EB88145E5B@povmail.pointofview.com>
Subject: Re: [Tiff] extracting 16-bit grayscale from photoshop
Date: Mon, 12 Sep 2005 21:38:15 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00000c08
X-MSP-STORE: Mon, 12 Sep 2005 21:42:55 +0200
Status:   

Hoan,

Hoan Chau wrote:
> Thus, I don't understand how the data can be interpreted one way in
> Photoshop and in another way by TiffReadScanline.

I suspect the difficulty here is how to interpret the color space. It's
a simple enough word, 'grayscale', but what does it mean...?

Some interpret 'grayscale' to mean RGB grayscale, R=G=B=grayscale. This
may seem intuitive, but in fact it is as arbitrary as any other
interpretation. Others feel that if no further information is provided,
grayscale should be taken to be the perceptually uniform grayscale, the
CIE L*a*b* grayscale, L*=grayscale and a*=b*=0. This also may seem
intuitive, and in fact it is what seems most intuitive to me personally,
but no doubt some will argue that it is as arbitrary as any other
interpretation.

There certainly is not much in the TIFF spec itself that creates more
certainty. The single out-of-place sentence 'Be aware that the
PhotometricInterpretation value of 0 or 1 (grayscale) implies linear
data because no gamma is specified.' may be some indication, but still,
it replaces the question 'what is grayscale' with the question 'what is
linear' and may not help much... Is it R=G=B=grayscale void of gamma? Or
should we interpret 'linear' to mean 'perceptually uniform, grayscale as
defined by human vision'? Or something else still?

The GrayResponse tags
(http://www.awaresystems.be/imaging/tiff/tifftags/grayresponsecurve.html
) were an early attempt at curing this problem. This never got broadly
supported though. Today, state of the art apps try to solve all this
kind of color confusion by embedding ICC profiles
(http://www.awaresystems.be/imaging/tiff/tifftags/iccprofile.html). Some
apps read them and apply them, and Photoshop is certainly one of them.
However, other apps ignore them, and LibTiff correctly leaves it to the
encapsulation application to resolve them (since LibTiff is only a
codec, not a color imaging engine).

Thus, it seems possible from your explanation that an ICC profile is
there and gets correctly applied by Photoshop, correctly ignored by
LibTiff TIFFReadScanline, and incorrectly ignored by this 'PolyView'.
You may want to check that. If no ICC profile is embedded, then this
must be a simple matter of different interpretation of 'grayscale', and
the only thing you can rely on for sure is that LibTiff TIFFReadScanline
correctly does no interpretation at all, for above reasons, and that
Photoshop's interpretation must be taken to be the industry standard
from the same company that also own the TIFF specification itself.

Mind you, I've never seen your image, and I'm not a color expert. I hope
this all helps, but I cannot guarante any of my comment is 100% correct.


Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
