Return-Path: <BCassanova@weather.com>
Received: from bee.skynet.be (bee.skynet.be [195.238.2.102])
        by twentyeight.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i0FKaa3F022171
        for <joris.at.lebbeke@skynet.be>; Thu, 15 Jan 2004 21:36:36 +0100
        (envelope-from <BCassanova@weather.com>)
Received: from dmzmm01.dmz.weather.com (mv.twc.weather.com [216.133.140.39])
        by bee.skynet.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i0FKEmgI020830
        for <joris.at.lebbeke@skynet.be>; Thu, 15 Jan 2004 21:14:50 +0100
        (envelope-from <BCassanova@weather.com>)
Received: from domino.twc.weather.com (Not Verified[216.133.141.140]) by dmzmm01.dmz.weather.com with NetIQ MailMarshal (v5.5.5.6)
	id <BB00071007>; Thu, 15 Jan 2004 15:15:23 -0500
Subject: Re: [Tiff] How to determine number of colors in the colormap
To: "Joris" <joris.at.lebbeke@skynet.be>
X-Mailer: Lotus Notes Release 5.0.11   July 24, 2002
Message-ID: <OFE0968C5B.6FF4B080-ON85256E1C.006ED2A4-85256E1C.006F48AA@twc.weather.com>
From: "Bill Cassanova" <BCassanova@weather.com>
Date: Thu, 15 Jan 2004 15:14:05 -0500
X-MIMETrack: Serialize by Router on domino/TWC(Release 5.0.10 |March 22, 2002) at 01/15/2004
 03:14:05 PM
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii
X-UIDL: ffe276f5a6ec81b647f4507368deb728


Ah,,,That makes since.  I did a little experiment and anded each of the red,
green, and blue values with
0xff to wipe out the high order bits...The values are now in the range of 0 to
255.

One curious note though.  If the largest number that could ever exist in a Red
or Green or Blue component
is 255 why would libtiff have defined the values coming out of a call to
TIFFGetField as uint16*?
My only thoughts are maybe libtiff was written with strictly a "C" interface in
mind and therefore function
overloading would not have been possible.  If they coded it for the largest
value that would ever be returned
from TIFFGetField then I guess uint16 is the right choice.

Thanks for the input.


                                                                                                                                 
                      "Joris"                                                                                                    
                      <joris.at.lebbeke        To:       "Tiff mailing list" <tiff@remotesensing.org>                            
                      @skynet.be>              cc:                                                                               
                      Sent by:                 Subject:  Re: [Tiff] How to determine number of colors in the colormap            
                      tiff-admin@remote                                                                                          
                      sensing.org                                                                                                
                                                                                                                                 
                                                                                                                                 
                      01/15/2004 02:50                                                                                           
                      PM                                                                                                         
                                                                                                                                 
                                                                                                                                 




> Thanks for writing.

No problem.

> So to read the colormap am I doing it correctly?  For some reason the
results I
> am getting are
> non-sensible.  I would have expected to see values in the range of 0 to
255.

It's been a while since I build my interface to that stuff. I plan to return
to it, that's the reason I'm here again, but when it comes to LibTiff,
someone else's advice is no doubt better than my vague memory.

No, you should expect values like the ones you're seeing. The palette
entries is 16bits per channel.

You could check your findings by comparing them with the output of my free
TIFF Tag Viewer application for windows.

http://www.awaresystems.be/free_downloads/astifftools.html

If you want to convert them to the more familiar 8bit per channel range, see
a very recent (and ongoing?) other thread on this subject tittled 'Colormap
and byte padding'. No disrespect to other posters in that thread (especially
no disrespect to myself, grin), but if you want a quick answer without
browsing through the whole thread I should suggest that Marti Maria is the
author of Little CMS and could be considered the authority on the matter.



Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://remotesensing.org/mailman/listinfo/tiff





