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 g8IJH8D8029832
	for <dron@at1895.spb.edu>; Wed, 18 Sep 2002 23:17:08 +0400
Received: from olympiakos.com (uucp@localhost)
	by nataly.at1895.spb.edu (8.12.4/8.12.4/Debian-4) with UUCP id g8IJH84p029829
	for dron@at1895.spb.edu; Wed, 18 Sep 2002 23:17:08 +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 TAA03886
	for <dron@at1895.spb.edu>; Wed, 18 Sep 2002 19:16:11 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 XAA83076
	for <dron@at1895.spb.edu>; Wed, 18 Sep 2002 23:15:02 +0400 (MSD)
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id PAA24071;
	Wed, 18 Sep 2002 15:11:27 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Wed, 18 Sep 2002 15:03:44 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id PAA23980
	for tiff-outgoing; Wed, 18 Sep 2002 15:03:43 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from arcticus.com ([66.7.173.250])
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id PAA23977
	for <tiff@olympiakos.com>; Wed, 18 Sep 2002 15:03:41 -0400
Received: (qmail 4850 invoked by uid 0); 18 Sep 2002 19:11:34 -0000
Received: from unknown (HELO 3dnature.com) (192.168.2.11)
  by 0 with SMTP; 18 Sep 2002 19:11:34 -0000
Message-ID: <3D88CE6F.8030408@3dnature.com>
Date: Wed, 18 Sep 2002 13:05:19 -0600
From: "Chris 'Xenon' Hanson" <xenon@3dnature.com>
Reply-To: xenon@3dnature.com
Organization: Arcticus
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020512 Netscape/7.0b1
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Steven Luke <steven.luke@mail.tju.edu>, tiff@olympiakos.com
Subject: Re: Reading 16bits from a gray scale image
References: <001c01c25f3c$5a93b020$469ca10a@jci.tju.edu> <002301c25f44$2b34f160$469ca10a@jci.tju.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Content-Transfer-Encoding: 7bit
Status: RO
Content-Length: 1862
Lines: 43

Steven Luke wrote:
> Let me clarify my last email, I am not sure it was so clear what I 
> needed to do:
>  >>How can I turn the 8bit or 32bit data into 16bits?
> Meant: How can I use this 8bit or 32bit data to reconstruct the origenal 
> 16bit value?
>  >>Tried only shifting the pixels by 4 in line [9] since the data was 
> actually acquired in 12 bits then stored as 16, but I got the same results.


   AFAIK, you cannot get the 16-bit (per channel) data back from the 32-bit APIs
like TIFFReadRGBAImage. The 32-bits is 8-bits per channel, 3 or 4 channels. You
want 16 bits per channel, one channel I expect. No matter how many channels you
get out of the TIFFReadRGBAImage output, each channel will never be more than
8 bits.

> I am displaying the image in 8bits so the final number needs to be only 
> 8bits

   So, why are fiddling with it at all? Just use the 8-bit data found in the
first channel provided by TIFFReadRGBAImage, and you're set. If the input
was single-channel, 8 or 16 bit, then all three channels provided by
TIFFReadRGBAImage will be equivalent and you can use whichever you like.

> that is why I shifted the pixels the opposite direction at the 
> end.  I am not sure if I am doing this step correct either.  I was 
> thinking of dividing by 257 but am unsure of the rounding process and 
> think that this is probably just as good because it is easier.

   I think you're making it harder than you need to.

> Thanks again.
> steven Luke

Chris - Xenon
-- 
  Chris Hanson | Xenon@3DNature.com | I've got friends in low latitudes!
        New World Construction Set 6!: http://www.3DNature.com/
  "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen


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

