Received: from inav034.isp.belgacom.be (localhost.localdomain [127.0.0.1])
	by inav034.isp.belgacom.be (Postfix) with ESMTP id 750EB3FB4A
	for <joris.at.lebbeke@skynet.be>; Wed, 17 Jan 2007 04:13:19 +0100 (CET)
Received: from inas005.isp.belgacom.be (inas005.isp.belgacom.be [195.238.4.11])
	by inav034.isp.belgacom.be (Postfix) with ESMTP id 5F2FC3FB50
	for <joris.at.lebbeke@skynet.be>; Wed, 17 Jan 2007 04:13:19 +0100 (CET)
Received: from inmx013.isp.belgacom.be (inmx013.isp.belgacom.be [195.238.4.216])
        by inas005.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id l0H3DCWq014576
        for <joris.at.lebbeke@skynet.be>; Wed, 17 Jan 2007 04:13:15 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx013.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l0H3D6ma022323
        for <joris.at.lebbeke@skynet.be>; Wed, 17 Jan 2007 04:13:06 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l0H2w1VN028501;
	Tue, 16 Jan 2007 21:58:09 -0500
Received: from scooby.simplesystems.org (scooby.simplesystems.org
	[65.66.246.67])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l0H2vxMT028498
	for <tiff@lists.maptools.org>; Tue, 16 Jan 2007 21:57:59 -0500
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by scooby.simplesystems.org (8.12.10+Sun/8.12.10) with ESMTP id
	l0H2vrw5003191; Tue, 16 Jan 2007 20:57:53 -0600 (CST)
Date: Tue, 16 Jan 2007 20:57:53 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@blade.simplesystems.org
To: Craig Bruce <csbruce@cubewerx.com>
Subject: Re: [Tiff] Elevation Data
In-Reply-To: <200701170225.l0H2PhRY014173@tux.cubewerx.com>
Message-ID: <Pine.SOC.4.60.0701162049080.13644@blade.simplesystems.org>
References: <200701170225.l0H2PhRY014173@tux.cubewerx.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: TIFF mailing list <tiff@lists.maptools.org>
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00001f81
X-MSP-STORE: Wed, 17 Jan 2007 04:13:19 +0100
Status:   

On Tue, 16 Jan 2007, Craig Bruce wrote:

> I would like to write signed 16-bit elevation data to a TIFF image file,
> but according to the TIFF 6.0 specification, there doesn't appear to
> be a correct way to do this.  The specification allows the use of the
> SampleFormat to specify that the samples are signed 16-bit integers, but
> this range of values is incompatible with the PhotometricInterpretation
> tag, which must be present.  The obvious PhotometricInterpretation to
> use is BlackIsZero, but its range is defined as 0 to 2**nbits-1 (i.e.,
> unsigned integers).
>
> So, how does one make a correct image using a SampleFormat other than
> unsigned integer?  What is the most compatible incorrect approach?

Libtiff uses the names PHOTOMETRIC_MINISWHITE and 
PHOTOMETRIC_MINISBLACK.  This implies something different than 
BlackIsZero.  Does that help?

> Also, is there a semantic difference between SMinSampleValue and
> MinSampleValue?  The spec explicitly states that MinSampleValue is
> just statistical and isn't part of a valid-sample-range definition,
> but it's much more coy about SMinSampleValue.  If it isn't part of a
> hard range definition, then how can one make an interoperable image with
> floating-point samples?

It seems difficult to make a completely interoperable image using 
floating-point samples.  I have heard that some software which 
supports floating-point TIFF checks all the sample values in order to 
best understand how it should be displayed (assuming it can be 
reasonably displayed at all).

Adobe issued a new draft specification (dated April 8, 2005) which 
discusses floating point in TIFF as implemented in Adobe Photoshop 
CS2.  Unfortunately, it does not address sample ranges other than to 
reference openexr documentation.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
