Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas011.isp.belgacom.be (localhost [127.0.0.1])
        by inav004.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id kB5GYsRq024213
        for <joris.at.lebbeke@skynet.be>; Tue, 5 Dec 2006 17:34:55 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx017.isp.belgacom.be (inmx017.isp.belgacom.be [195.238.4.129])
        by inas011.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id kB5GYgJL031123
        for <joris.at.lebbeke@skynet.be>; Tue, 5 Dec 2006 17:34:46 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx017.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id kB5GYYbf021886
        for <joris.at.lebbeke@skynet.be>; Tue, 5 Dec 2006 17:34:35 +0100
        (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 kB5GF35P014429;
	Tue, 5 Dec 2006 11:16:14 -0500
Received: from outfbmx014.isp.belgacom.be (outfbmx014.isp.belgacom.be
	[195.238.6.70])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id kB5GEZQK014414
	for <tiff@lists.maptools.org>; Tue, 5 Dec 2006 11:14:36 -0500
Received: from outmx001.isp.belgacom.be (outmx001.isp.belgacom.be
	[195.238.5.51])
	by outfbmx014.isp.belgacom.be (Postfix) with ESMTP id 454EE569C9B
	for <tiff@lists.maptools.org>; Tue,  5 Dec 2006 16:52:34 +0100 (CET)
Received: from outmx001.isp.belgacom.be (localhost [127.0.0.1])
	by outmx001.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22)
	with ESMTP id kB5FqUKZ025323
	for <tiff@lists.maptools.org>; Tue, 5 Dec 2006 16:52:31 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (187.180-245-81.adsl-dyn.isp.belgacom.be
	[81.245.180.187])
	by outmx001.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22)
	with SMTP id kB5FqLui025157
	for <tiff@lists.maptools.org>; Tue, 5 Dec 2006 16:52:21 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <003501c71885$5a33a700$bbb4f551@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "TIFF mailing list" <tiff@lists.maptools.org>
Date: Tue, 5 Dec 2006 16:52:19 +0100
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.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
Subject: [Tiff] Grayscale, or is it?
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.00001e00
X-MSP-STORE: Tue, 05 Dec 2006 17:34:58 +0100
Status:   

Folks,

I'm forever having trouble with grayscale in TIFF, except that now I
really need to resolve it and make a final descision.

The TIFF spec, in "Section 4: Grayscale images" does not contain a good
definition of grayscale. However, on page 73, "Comments for TIFF
writers", in a discussion of gamma, it says "Be aware that the
PhotometricInterpretation value of 0 or 1 (grayscale) implies linear
data because no gamma is specified. The PhotometricInterpretation value
of 2 (RGB data) specifies the NTSC gamma of 2.2 as a default."

Now, what is linear data? Linear to what? What is grayscale, for that
matter?

I see three possibilities.

1) Greyscale is R=G=B. I think this interpretation is consistent with
most common practice. It is also consistent with the LibTiff RGBA
interface implementation, in that this just sets R, G, and B, to the
greyscale read from the TIFF. It is however a clear violation of the
above quoted remark on gamma.

2) Greyscale is power(R=G=B,1/2.2). In other words, we keep the
intuitive notion of greyscale based on the RGB space that itself is not
very strictly defined (but we could and can assume it to mean sRGB that
has a better definition), but we compensate gamme. This is consistent
with the above quoted remark on gamma. It is, however, likely not very
common to do this, thus resulting in an unintended interpretation of
most image data out there.

3) Greyscale is best defined on the basis of a more scientific color
space, and CIE L*a*b* is most suitable. In other words, MinIsBlack
greyscale is L*/100.0 (encoded in 8bit integer format, MinIsBlack
grayscale equals L*), MinIsWhite greyscale is 1.0-L*/100 (encoded in
8bit integer format, MinIsWhite greyscale equals 255-L*).

Sofar, I've been going with option 3. But that may not have been a good
choice...

True, people who want to write unambigious greyscale could write
Photometric CIELAB or ICCLAB with SamplesPerPixel-ExtraSamples==1. That
should unambigiously communicate L* greyscale. But this observation does
not solve my problem as to how to interpret MinIsBlack and MinIsWhite
greyscale.

Anyone has any advice on this matter?


Best regards,

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/
