Return-Path: <owner-tiff@olympiakos.com>
Received: from nataly.at1895.spb.edu (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.4/8.12.4/Debian-4) with ESMTP id g8IJVSD8001374
	for <dron@at1895.spb.edu>; Wed, 18 Sep 2002 23:31:28 +0400
Received: from olympiakos.com (uucp@localhost)
	by nataly.at1895.spb.edu (8.12.4/8.12.4/Debian-4) with UUCP id g8IJVSQY001372
	for dron@at1895.spb.edu; Wed, 18 Sep 2002 23:31:28 +0400
Received: from knot.pu.ru (knot.pu.ru [193.124.85.214] (may be forged))
	by wg.pu.ru (8.9.1a/8.9.1) with ESMTP id TAA05890
	for <dron@at1895.spb.edu>; Wed, 18 Sep 2002 19:25:41 GMT
Received: from gate7.olympiakos.com (sdsl-64-32-199-150.dsl.iad.megapath.net [64.32.199.150])
	by knot.pu.ru (8.9.3/8.9.0) with ESMTP id XAA83714
	for <dron@at1895.spb.edu>; Wed, 18 Sep 2002 23:25:40 +0400 (MSD)
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id PAA24204;
	Wed, 18 Sep 2002 15:24:01 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Wed, 18 Sep 2002 15:17:35 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id PAA24145
	for tiff-outgoing; Wed, 18 Sep 2002 15:17:34 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from telesmtp3.mail.isp ([213.4.129.150])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id PAA24142
	for <tiff@olympiakos.com>; Wed, 18 Sep 2002 15:17:28 -0400
Received: from MM2000 ([213.97.41.5]) by telesmtp3.mail.isp
          (Netscape Messaging Server 4.15 telesmtp3 Mar 14 2002 21:29:48)
          with ESMTP id H2NEX201.G63; Wed, 18 Sep 2002 21:17:26 +0200 
Message-ID: <000c01c25f75$3a016ee0$02001aac@MM2000>
From: =?iso-8859-1?Q?Mart=ED_Maria?= <marti@littlecms.com>
To: "Steven Luke" <steven.luke@mail.tju.edu>, <tiff@olympiakos.com>
References: <001c01c25f3c$5a93b020$469ca10a@jci.tju.edu> <002301c25f44$2b34f160$469ca10a@jci.tju.edu>
Subject: Re: Reading 16bits from a gray scale image
Date: Wed, 18 Sep 2002 21:20:58 -0320
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0009_01C25F59.47FC7290"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
Content-Length: 3289
Lines: 93

This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C25F59.47FC7290
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


>I am displaying the image in 8bits so the final number=20
>needs to be only 8bits, that is why I shifted the pixels=20
>the opposite direction at the end.  I am not sure if I am=20
>doing this step correct either.  I was thinking of dividing=20
>by 257 but am unsure of the rounding process and think=20
>that this is probably just as good because it is easier.

The correct method would be to divide by 257 and then round:

    r =3D floor(c / 257.0 + 0.5)

However this is painfull slow. If you don't care about memory,=20
you could use a table of 64K for speeding up... other options=20
would be to use fixed point.

Anyway, for most usages a simple >> 8 is enough.

Regards,
Marti.


------=_NextPart_000_0009_01C25F59.47FC7290
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>&gt;I am displaying the image in 8bits =
so the final=20
number </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;needs to be only 8bits, that is why =
I shifted=20
the pixels </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;the opposite direction at the =
end.&nbsp; I am=20
not sure if I am </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;doing this step correct =
either.&nbsp; I was=20
thinking of dividing </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;by 257 but am unsure of the =
rounding process=20
and think </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;that this is probably just as good =
because it=20
is easier.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The correct method would be to divide =
by 257 and=20
then round:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; r =3D floor(c / =
257.0 +=20
0.5)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However this is painfull slow. If you =
don't care=20
about memory, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>you could use a table of 64K for =
speeding up...=20
other options </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>would be to use fixed =
point.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Anyway, for most usages a simple =
&gt;&gt; 8 is=20
enough.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marti.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></DIV></BODY></HTML>

------=_NextPart_000_0009_01C25F59.47FC7290--


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

