Return-Path: <andy.cave@hamillroad.com>
Received: from kay.skynet.be (kay.skynet.be [195.238.3.235])
        by twentyeight.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i0EHSQH5004554
        for <joris.at.lebbeke@skynet.be>; Wed, 14 Jan 2004 18:28:26 +0100
        (envelope-from <andy.cave@hamillroad.com>)
Received: from ns.name-hog.biz (nenets.com [212.67.193.26] (may be forged))
        by kay.skynet.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i0EHRbtk023509
        for <joris.at.lebbeke@skynet.be>; Wed, 14 Jan 2004 18:27:39 +0100
        (envelope-from <andy.cave@hamillroad.com>)
Received: from PLATO (81-178-2-108.dsl.pipex.com [81.178.2.108])
	by ns.name-hog.biz (8.10.2/8.10.2) with SMTP id i0EHLmB14173;
	Wed, 14 Jan 2004 17:21:48 GMT
Message-ID: <03a601c3dac3$9b5fca90$0200a8c0@PLATO>
From: "Andy Cave" <andy.cave@hamillroad.com>
To: "Gerben Vos" <gerben@zylab.com>,
   "Tiff mailing list" <tiff@remotesensing.org>
Cc: "Joris" <joris.at.lebbeke@skynet.be>
References: <44E68E8A7590D411862200508B9AFC2201AFF30A@zymail.zylab.nl>
Subject: Re: [Tiff] COLORMAP and byte padding
Date: Wed, 14 Jan 2004 17:26:49 -0000
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.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-UIDL: a576577addd12e409be863b2705f6e5f
Status: U

I really wouldn't do that. The 'solution' of dividing by 256 is far more
accurate.

With 256:

0 to 255 -> 0,
256 to 511 -> 1,
...
65280 to 65535 ->255.

This gives an even map of 256 values down to each resultant value.

With 257:

0 to 256 -> 0,
257 to 513 -> 2,
...
65278 to 65534 -> 254
65535 ->255.

NOT an even spread.

_andy.

----- Original Message -----
From: "Gerben Vos" <gerben@zylab.com>
To: "Tiff mailing list" <tiff@remotesensing.org>
Cc: "Joris" <joris.at.lebbeke@skynet.be>
Sent: Wednesday, January 14, 2004 5:13 PM
Subject: Re: [Tiff] COLORMAP and byte padding


> > uint8val = uint16val/65535*255
> >              = uint16val/257
>
> > Are you sure that boils down to >>8? I'd have to check...
>
> Oops, no. That's wrong in 16256 cases, roughly 24.8%. Should have checked
before I spoke. My deepest apologies.
>
> Guess downconverting has to be slow, unless you know you've taken Frank's
not quite precise shortcut when upconverting. (Well, if you feel the need
for speed you could always sacrifice 65536 bytes to a lookup table.)
>
> Gerben.
> _______________________________________________
> Tiff mailing list
> Tiff@remotesensing.org
> http://remotesensing.org/mailman/listinfo/tiff
>


