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.0.Beta7/8.12.0.Beta7) with ESMTP id f4UElQqH018184
	for <dron@localhost>; Wed, 30 May 2001 18:47:50 +0400
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.8.1)
	for dron@localhost (single-drop); Wed, 30 May 2001 18:47:50 +0400 (MSD)
Received: from gate7.olympiakos.com ([207.176.88.85]) by shared1-mail.whowhere.com; Wed May 30 06:50:11 2001
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id JAA14609;
	Wed, 30 May 2001 09:35:32 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Wed, 30 May 2001 09:33:04 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id JAA14472
	for tiff-outgoing; Wed, 30 May 2001 09:33:03 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from lysithea.eastgw.xerox.com (lysithea.xerox.com [208.140.33.22])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id JAA14469
	for <tiff@olympiakos.com>; Wed, 30 May 2001 09:33:01 -0400
Received: from godzilla.ADOC.xerox.com (godzilla.ADOC.xerox.com [13.242.128.10])
	by lysithea.eastgw.xerox.com (8.9.3/8.9.3) with ESMTP id IAA20829
	for <tiff@olympiakos.com>; Wed, 30 May 2001 08:34:46 -0400 (EDT)
Received: from mercury.adoc.xerox.com (mercury [13.242.100.20])
	by godzilla.ADOC.xerox.com (8.8.8+Sun/8.8.8/ADOC-HUB-1.7) with ESMTP id FAA07193
	for <tiff@olympiakos.com>; Wed, 30 May 2001 05:34:45 -0700 (PDT)
Received: by mercury.ADOC.xerox.com with Internet Mail Service (5.5.2653.19)
	id <LS8QKKWT>; Wed, 30 May 2001 05:34:44 -0700
Message-ID: <51B8ABCE456FD111899900805F6FD6EE09F02861@mercury.ADOC.xerox.com>
From: "Knutsen, Dale" <Dale.Knutsen@pahv.xerox.com>
To: tiff@olympiakos.com
Subject: How do ReferenceBlackWhite and TransferFunction interact for RGB 
	photometry?
Date: Wed, 30 May 2001 05:34:43 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="iso-8859-1"
Sender: owner-tiff@olympiakos.com
Status: RO
Content-Length: 1723
Lines: 42

I am having difficulty conclusively interpreting the TIFF 6.0 spec (section
20 "RGB Image Colorimetry") -- specifically in how ReferenceBlackWhite and
TransferFunction (when both are present) interact for RGB photometry. 

Here is my idea, can anyone confirm that this is correct or else describe
how it is supposed to work?

Summary: The raw value of an RGB component is first converted to a
zero-based value using ReferenceBlackWhite, and then that zero-based value
is used to index into the TransferFunction table. 

Here is what I find in the specification that leads me to this
understanding. 

1. The specification says this about ReferenceBlackWhite decoding: (quote)

    The full range component value is converted from the code by:

    FullRangeValue = (code - ReferenceBlack) * CodingRange 
        / (ReferenceWhite - ReferenceBlack);

2. The specification says this about TransferFunction (this text is under
the TransferRange heading): (quote)

    After ReferenceBlackWhite and/or YCbCr decoding has taken place, 
    an RGB value can be represented as a real number. 
    It is then rounded to create an index into the 
    TransferFunction table. In the absence of a TransferRange tag, 
    or if the tag has the default values, the rounded value 
    is an index and the normalized intensity value is:

    index = (int) (value + (value < 0.0? -0.5 : 0.5));
    intensity = TF[index] / 65535;

One implication of the above is that the TransferFunction table *always*
covers the domain from black to white, and does not map input values that
are whiter than reference white nor blacker than reference black. 

Thanks for any help in understanding this...

	Dale Knutsen
       Xerox Research & Technology

