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 -1) with ESMTP id f9Q9SSwb012382
	for <dron@localhost>; Fri, 26 Oct 2001 13:28:55 +0400
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.9.0)
	for dron@localhost (single-drop); Fri, 26 Oct 2001 13:28:55 +0400 (MSD)
Received: from gate7.olympiakos.com ([207.176.88.85]) by shared1-mail.whowhere.com; Thu Oct 25 15:07:32 2001
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id RAA07751;
	Thu, 25 Oct 2001 17:55:29 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Thu, 25 Oct 2001 17:52:30 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id RAA07705
	for tiff-outgoing; Thu, 25 Oct 2001 17:52:14 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from firebird.planetinternet.be (firebird.planetinternet.be [195.95.34.5])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id RAA07702
	for <tiff@olympiakos.com>; Thu, 25 Oct 2001 17:52:11 -0400
Received: from planetinternet.be (u212-239-164-144.adsl.pi.be [212.239.164.144])
	by firebird.planetinternet.be (8.11.6/8.10.0) with ESMTP id f9PLq2i18749;
	Thu, 25 Oct 2001 23:52:02 +0200
Message-ID: <3BD889D0.F777CE11@planetinternet.be>
Date: Thu, 25 Oct 2001 23:53:20 +0200
From: Joris Van Damme <as.van.damme.joris@planetinternet.be>
Organization: AWare Systems
X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: =?iso-8859-1?Q?Mart=ED?= Maria <marti@littlecms.com>,
   TIFF Mailing List 
	<tiff@olympiakos.com>
Subject: Re: 16-bit ICC L*a*b* ?
References: <Pine.LNX.4.21.0110051822440.18017-100000@gate.apago.com> <003601c14e73$cbdbcdb0$02001aac@MM2000>
Content-Type: text/plain; charset=iso-8859-1
Sender: owner-tiff@olympiakos.com
Precedence: bulk
X-MIME-Autoconverted: from 8bit to quoted-printable by gate7.olympiakos.com id RAA07751
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by at1895.spb.edu id f9Q9SSwb012382
Status: RO
Content-Length: 1982
Lines: 63

Martí Maria wrote:
> Lab TIFF of 8 bits are encoded using:
> 
>          L   : 0...FF -> 0..100
>          a,b:  0..FF  -> -128...127
> 
> To decode to float, you need to divide L by 2.55. For the a, b parts,
> substract 128 if greater that 127. 

I'm sorry, but this must be a typo or something. If you substract 128 if
>127, you end up with two ways to encode the range 0 to 127, and no way to encode negative values.

This is the way I currently interpret 24bit lab in tiff. Integer source
values in 24bit tiff lab are al,aa,ab; floating point destination values
in CIE L*a*b* are bl,ba,bb; no floating point calculation optimization
for clearity.

procedure XPVtifflab24ToVlabf(const al,aa,ab: Integer; var bl,ba,bb:
Cft);
begin
  bl:=al/2.55;
  if aa<128 then
    ba:=aa
  else
    ba:=aa-255;
  if ab<128 then
    bb:=ab
  else
    bb:=ab-255;
end;

I don't know if this is correct, I can only judge this with my eyes so
it is very possible that constants here should actually be one more or
one less or something. Your comments would be much appreciated.

> The 16 bit form uses fixed point 7.8
> for a, b. This is a rare case, where simple shifting << 8 and >> 8 can
> be used to convert between 8/16 representations.

Since you give the convertion to 24bit tiff lab here, I'm not able to
interpret it either. Based on what you say here about shifting, one
single testimage, and my eyes as final judge of correctness, this seems
to come very close (again, conversion to floating point CIE L*a*b* given
here for clearity, again same naming conventions):

procedure XPVtifflab48iToVlabf(const al,aa,ab: Integer; var bl,ba,bb:
Cft);
begin
  bl:=al/256/2.55;
  ba:=aa/256-128;
  bb:=ab/256-128;
end;

Is this correct? I have only my eyes to judge, and would therefore much
appreciate your knowledgeable comments.




Joris

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

