Return-Path: <tiff-admin@remotesensing.org>
Received: from inav009.isp.belgacom.be (inav009.isp.belgacom.be [195.238.3.61])
        by six.skynet.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i2OMrDqC023002
        for <joris.at.lebbeke@skynet.be>; Wed, 24 Mar 2004 23:53:13 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from inmx012.isp.belgacom.be (inmx012.isp.belgacom.be [195.238.3.90])
        by inav009.isp.belgacom.be (8.12.9/8.12.9/Skynet-IN-AV-2.02) with ESMTP id i2OMr25k017129
        for <joris.at.lebbeke@skynet.be>; Wed, 24 Mar 2004 23:53:02 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.42])
        by inmx012.isp.belgacom.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i2OMqvEQ023378
        for <joris.at.lebbeke@skynet.be>; Wed, 24 Mar 2004 23:52:58 +0100
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i2OMq7l16748;
	Wed, 24 Mar 2004 17:52:07 -0500
Received: from outmx015.isp.belgacom.be (outmx015.isp.belgacom.be [195.238.2.87])
	by yoda.imagelinks.com (8.11.6/8.11.2) with ESMTP id i2OMptl16729
	for <tiff@remotesensing.org>; Wed, 24 Mar 2004 17:51:55 -0500
Received: from dfgrrxsknr4e (202.42-200-80.adsl.skynet.be [80.200.42.202])
        by outmx015.isp.belgacom.be (8.12.9/8.12.9/Skynet-OUT-2.21) with SMTP id i2OMphMO006533;
	Wed, 24 Mar 2004 23:51:43 +0100
        (envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <004101c411f2$979c0980$ca2ac850@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Tiff mailing list" <tiff@remotesensing.org>,
   "Wendel Dean Renner" <WendelDRenner@comcast.net>
References: <4061A708.9010207@comcast.net>
Subject: Re: [Tiff] Need consultant
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.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-RAVMilter-Version: 8.4.3(snapshot 20030212) (inav009.isp.belgacom.be)
X-RAVMilter-Version: 8.4.3(snapshot 20030212) (outmx015.isp.belgacom.be)
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Wed, 24 Mar 2004 23:51:48 +0100
X-UIDL: a62f7df7dbd2d08542daf784339e3a4b

> The tiff library only goes to 8 bit.

There's no such thing as a limit to 8 bit, not in the TIFF specification, and
not in LibTiff.

> We have a
> routine that makes calls to the libtiff  library to decode an image that
> is 8 bit, but don't know how to modify things to handle 16 bits per
> pixel, be it true color or gray scale.

Either this routine uses the RGBA interface, or it goes about the proper way.

* RGBA interface *
Is really unfortunate. I think it probably came about because people ignorant of
the actual file format expect such an interface, possibly because other formats
and libraries more naturally provide such an interface. The consequence of this
interface is that there's people reading singlebit black and white as 32bit RGBA
and such, and the fact that we periodically see messages that go from the
assumption TIFF or LibTiff does not support anything beyond 8bit per channel may
have something to do with this interface, also. This interface I do not
recommend, it is kinda like 'LibTiff for dummies', but, obviously, you have a
professional need and should not be misguided into using the RGBA interface. And
even true dummies should not be tempted into lowering standards when it's not at
all difficult to go about things in better ways, but should instead receive
proper documentation.

* the proper way *
Has no such limitation. Has very little limitation at all, TIFF is very
flexible, and so is LibTiff (only thing TIFF allows and LibTiff does not is
different bitdepths for different channels in same raster, to the best of my
knowledge). This interface documented in the LibTiff documentation. Here's some
additional pointers. First two are URL's to good documentation on how to use
LibTiff the good natural way. Next two are pointers to the long-term mailing
list archive, riddled with information on TIFF and LibTiff.

http://www.ibm.com/developerworks/linux/library/l-libtiff/
http://www-106.ibm.com/developerworks/linux/library/l-libtiff2/
http://www.remotesensing.org/libtiff/tml/index.html
http://www.awaresystems.be/tiff_mailing_list/index.html

> Is there anyone who could do this for us?

You don't need a consultant, you need some courage, some good pointers like the
ones given here, and at most a couple of hours of research. Don't take my word
for it though. If you're still eager to needlessly throw money at it anyway,
please note my signature. My company is not very active in C or C++, but in
Borland Delphi. For big spenders, we'll do just about anything though.

> if the file is 16 bits each of red, green, blue, one would
> just take the average of each of those three signals at each pixel

I don't know the context, so maybe I'm missing something. *If* the goal is true
convertion from RGB to grayscale, then simple average will not do. In fact, this
is off sofar as to render 16 bits of precision completely useless. There's tons
of convertion formulae scattered all over the web that are (slightly) better.
Most of these find their roots in ancient analog devices, and not in color
theory. Is why I wanted to warn about these, too (and expect someone to quote
some at me). I believe the correct way to do it is to convert RGB to Y (as in
XYZ), and next convert Y back to either grayscale (as in R=G=B) or brightness
(as in L*), depending on what exactly you're after (display on common RGB
display device, or perceptually proportional grayscale for further processing).



Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

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