Received: from [209.42.233.245] by phillip.cerious.com (NTMail 3.03.0017/7.aaxh) with ESMTP id pcrews for <pcrews@cerious.com>; Fri, 20 Oct 2000 12:24:00 -0400
Received: from gate7.olympiakos.com (207.176.88.85) by mail2.calvander.com
 with ESMTP (Eudora Internet Mail Server 3.0) for <pcrews@cerious.com>; 
 Fri, 20 Oct 2000 04:11:11 -0400
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id EAA28970;
	Fri, 20 Oct 2000 04:17:02 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Fri, 20 Oct 2000 04:15:11 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id EAA28871
	for tiff-outgoing; Fri, 20 Oct 2000 04:15:10 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from abaforum.es (mail.abaforum.es [194.179.88.8] (may be forged))
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id EAA28868
	for <tiff@olympiakos.com>; Fri, 20 Oct 2000 04:15:08 -0400
Received: from vent [213.220.15.5] by abaforum.es
  (SMTPD32-6.00) id AED82E1021C; Fri, 20 Oct 2000 10:14:16 +0200
Message-ID: <001401c03a6d$698d7b60$050fdcd5@vent>
From: Martí Maríay7WE= <martim@abaforum.es>
To: "Michael O'Rourke" <morourke@Adobe.COM>, <tiff@olympiakos.com>
References: <IJEEKGEBDCHCGMJDLMHHGEDBCCAA.morourke@adobe.com>
Subject: RE: reading LAB files
Date: Fri, 20 Oct 2000 10:11:41 +0200
Organization: 
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 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Sender: owner-tiff@olympiakos.com

Hi,

> I seem to be having trouble reading LAB files.
>
> I have an LAB file where Photshop show the first pixel as (55,22,-10).
>
> When I read it into an unsigned char array with ReadScanline, I get (140,
> 22, 146) which maps to (-116, 22, -10) when typecast to signed chars.
>
> So, what's up with the -116? Does libtiff do something special to LAB files?
> I grep'd the code, but didn't seem to find anything.

Lab TIFF are encoded using

        L   : 0...FF -> 0..100
        a,b:  0..FF  -> -128...127

So,  you need to divide L by 2.55 and substract 128 to a,b parts to get float values. Also, TIFF lab does use D65 as white point (as
opposed to D50, widely used on prepress). Note that this encoding is very usefull for simpler operations, and converting  to float
is very time consuming. If you want the float values to pass to XYZ and then to RGB by float formulae, you shurely will find this is
a neverending process.

Marti Maria
The little cms project
http://www.abaforum.es/martim/lcms.htm
mailto:martim@abaforum.es


