Return-Path: <tiff-bounces@remotesensing.org>
Received: from inav013.isp.belgacom.be (inav013.isp.belgacom.be [195.238.2.245])
        by mailst034.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i9KJs1bB028731
        for <joris.at.lebbeke@skynet.be>; Wed, 20 Oct 2004 21:54:01 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inas014.isp.belgacom.be (localhost [127.0.0.1])
        by inav013.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id i9KJrwhK013810
        for <joris.at.lebbeke@skynet.be>; Wed, 20 Oct 2004 21:53:58 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inmx013.isp.belgacom.be (inmx013.isp.belgacom.be [195.238.2.216])
        by inas014.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id i9KJrqS1019246
        for <joris.at.lebbeke@skynet.be>; Wed, 20 Oct 2004 21:53:54 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx013.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i9KJrmAZ022237
        for <joris.at.lebbeke@skynet.be>; Wed, 20 Oct 2004 21:53:49 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 9A78E3D7D22; Wed, 20 Oct 2004 15:53:33 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from hornet.wiznet.ca (hornet.wiznet.ca [216.138.223.229])
	by xserve.flids.com (Postfix) with ESMTP id AC4253D7CFF
	for <tiff@remotesensing.org>; Wed, 20 Oct 2004 15:53:31 -0400 (EDT)
Received: from [192.168.2.6] (H156.C195.tor.velocet.net [216.138.195.156])
	by hornet.wiznet.ca (Postfix) with ESMTP
	id 48E1D328916; Wed, 20 Oct 2004 15:50:30 -0400 (EDT)
Message-ID: <4176C1C8.6090406@pobox.com>
Date: Wed, 20 Oct 2004 15:51:36 -0400
From: Frank Warmerdam <warmerdam@pobox.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Sachin Garg <schngrg@gmail.com>
Subject: Re: [Tiff] the BitsPerSymbol tag
References: <b35303704102011401c1217fa@mail.gmail.com>
In-Reply-To: <b35303704102011401c1217fa@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Tiff mailing list <tiff@remotesensing.org>
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 49bd7334793605862b72bf10d1ca13c3

Sachin Garg wrote:
>>From the Tiff6 documentation, it seems that a tiff image is supposed
> to have a BitsPerSymbol value for each sample in the image.
> 
> But from TiffDirectory implementation, it seems that we hold  a single
> "uint16 td_bitspersample" value for all samples.
> 
> Is it that all samples always have same bit-depth? it doesnt seems
> that way for documentation, for example it says that a 16-bit image
> usally has 5/6/5 bits per sample.
> 
> I also noticed a "uint16* td_sampleinfo;" in TiffDirectory, is it
> something related to this?

Sachin,

In theory the TIFF specification supports having samples in a TIFF file
with different bit depths.  In practice this is quite uncommon.  The
TIFF format does indeed store a value for each sample; however, there
was a deliberate decision within libtiff support to only support images
with all samples of the same type.  This is why the td_bitspersample is
a single scalar value.

Indeed, 16bit video cards are normally using 5/6/5 bits per plane for
red, green and blue.  Unfortunately, libtiff cannot read and write
TIFF files configured this way, though you can easily read and write the
data as 24bit by padding out each of the samples to 8bit.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

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