Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx1.pub.mailpod2-cph3.one.com ([10.27.25.11])
	by mailstorage18.cst.mailpod2-cph3.one.com (Dovecot) with LMTP id X4bEABlv8lq/dAAAQS8vrQ
	for <filtered@awaresystems.be>; Wed, 09 May 2018 03:47:09 +0000
X-HalOne-ID: a57a5c3c-533b-11e8-8d9d-e0d848957041
Received: from mail-oi0-f44.google.com (unknown [209.85.218.44])
	by mx1.pub.mailpod2-cph3.one.com (Halon) with ESMTPS
	id a57a5c3c-533b-11e8-8d9d-e0d848957041;
	Wed, 09 May 2018 03:47:08 +0000 (UTC)
Received: by mail-oi0-f44.google.com with SMTP id t27-v6so30284149oij.9
        for <filtered@awaresystems.be>; Tue, 08 May 2018 20:47:08 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :from:mime-version:message-id:date:to:subject:precedence:list-id
         :list-unsubscribe:list-archive:list-post:list-help:list-subscribe
         :mime-version:sender:errors-to;
        bh=pMULXCq9koxwAY0Bd7Ee66w5p2IC1FW3ENlabPvdqnw=;
        b=m1ZNDCHgfiOpu854I/X4XPUgkwKUJ6y0vSy4+OaqW/ABFB13flRBXowPTTpZy4uB2w
         PoW+2tldZ1ZfMw4JY8HXTayJru8JAxk7v8EnCjcjNjA/J/V8pu+Rh2ql82uPVLhJnoPC
         jZQdbgZK7Fjrq5zGcQNep+tYJRveTyNyY8W8ADMLrfQGr8RiPQ1rmdbtzz/W3F7u8FY5
         cEfzfFcDfrK7ur5p3cv36vg3iZhO35hy5UXKznwlHuXmI+nuqTd4r82N3ZgTEV6Vvv9E
         OcqhznDGc65JNVVBwdqlYRGGq0j3swre0xN3JHOo7PSA+cBFiP9n2iE4mvzP/wnZ1bOl
         XCHg==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
X-Gm-Message-State: ALQs6tD8DTQTK9qSs8sbciPLifL4jhdZOwT+r4Y0ggeQwMwKMNjHQ6AV
	ZYrisndCiDN7g/N9SWrojglQNOKiBBPoKTA09VwIN7YFIyJfODY=
X-Received: by 2002:aca:d6:: with SMTP id 205-v6mr28548905oia.351.1525837627401;
        Tue, 08 May 2018 20:47:07 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.74.101.13 with SMTP id y13csp5159875ooc;
        Tue, 8 May 2018 20:47:06 -0700 (PDT)
X-Google-Smtp-Source: AB8JxZrynwF3m/b4OaQsRoT000wfkuAM4/r5gi+MF5Pn1QG4hBhnVOnZZde3zJiZ8DKQ+IH8SpaD
X-Received: by 2002:adf:b0e2:: with SMTP id j31-v6mr32302652wra.263.1525837626335;
        Tue, 08 May 2018 20:47:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1525837626; cv=none;
        d=google.com; s=arc-20160816;
        b=qOtUFjBuX5SHq49DqIozosjSB/fcbl30KlNUxIZS2kfCaQxEIQaAgPo1xVXhaRtfaL
         WoDNV6lmXOv00sPZ2kQvHMc2GsCYqqZx3eDh8Tzpn48I+Uo+bjLS1U+u71kErvHtMEa8
         nwNhPw8L/50UaBh1RVDHFm0v5+nsBrvzGMzy2++oHbWTVegJ4sIAYQGjEy1DbqhXKnUP
         5n8x8T9ALx192YS3OHl5FeLST/Ho+ouUohPD1QvfLuqJHi3H+Ka9NYOU3BzKjacS2wqR
         D7FXqlftbj/7/5wXF7ljMBLhFUlMYCIjfpzTcxV++wvBjCsk1CgOiTLfIFVdOdfDIWLK
         gbpw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=errors-to:sender:mime-version:list-subscribe:list-help:list-post
         :list-archive:list-unsubscribe:list-id:precedence:subject:to:date
         :message-id:mime-version:from:arc-authentication-results;
        bh=pMULXCq9koxwAY0Bd7Ee66w5p2IC1FW3ENlabPvdqnw=;
        b=l4Q+J00tYyNAYBtqcqjTskgqkMcjcNBZ24rnNk7ce0kw9a8ouI85DP52vEqNradYQf
         hqlWO2BtzcOzePtGPGFKziW6DBepzpx14kOiAJxQYFq0jSryVRHHBiaWyBsDXENQ6jeU
         UjBe5CZO3Jt9h9YJGA+gNhES68c8OgonTm4cECx9fe0wmtfiIhJOpCiFsGwUXfw5FJcG
         MbIoQOKR2DZSCi31UccxmDRWLRLutdNIk0VboodC4OGp9+dyHyINOCULxnzKyh1vGX9/
         dHv6ER7qGBkcLA+Qhlbd+chGuLxD7enMYmHwwB+dDwLiVfocSog7f3cxIdAx3wAQpWJa
         uLIw==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id f195-v6si7142758wmg.133.2018.05.08.20.47.05;
        Tue, 08 May 2018 20:47:06 -0700 (PDT)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 7E22E35C03C;
	Tue,  8 May 2018 22:46:10 -0500 (EST)
Received: from homiemail-a4.g.dreamhost.com (homie.mail.dreamhost.com
	[208.97.132.208])
	by lists.maptools.org (Postfix) with ESMTPS id 408AE35C039
	for <tiff@lists.maptools.org>; Tue,  8 May 2018 22:45:42 -0500 (EST)
Received: from homiemail-a4.g.dreamhost.com (localhost [127.0.0.1])
	by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id 1AD8F51C088
	for <tiff@lists.maptools.org>; Tue,  8 May 2018 20:45:40 -0700 (PDT)
Received: from sake.hitronhub.home (S0106f0f249b09b33.vc.shawcable.net
	[174.7.127.0])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: lg@larrygritz.com)
	by homiemail-a4.g.dreamhost.com (Postfix) with ESMTPSA id E674B51C073
	for <tiff@lists.maptools.org>; Tue,  8 May 2018 20:45:39 -0700 (PDT)
From: Larry Gritz <lg@larrygritz.com>
Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\))
Message-Id: <BFFF297C-F17F-493D-8D6F-2EF79A28BC8E@larrygritz.com>
Date: Tue, 8 May 2018 20:45:39 -0700
To: tiff@lists.maptools.org
X-Mailer: Apple Mail (2.3445.6.18)
Subject: [Tiff] Question about transfer function
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
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>
Content-Type: multipart/mixed; boundary="===============0508743211=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org


--===============0508743211==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_FFB81B22-66DA-49BC-8A16-42399EFFA202"


--Apple-Mail=_FFB81B22-66DA-49BC-8A16-42399EFFA202
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

I'm embarrassed to say that today I stumbled on a statement in the TIFF =
6.0 spec that had somehow eluded me previously in nearly 30 years of =
dealing with TIFF files. To wit:

"Be aware that the PhotometricInterpretation value of 0 or 1 (grayscale) =
implies linear data because no gamma is specified. The =
PhotometricInterpretation value of 2 (RGB data) specifies the NTSC gamma =
of 2.2 as a default. If data is written as something other than the =
default, then a GrayResponseCurve field or a TransferFunction field must =
be present to define the deviation. For grayscale data, be sure that the =
densities in the GrayResponseCurve are consistent with the =
PhotometricInterpretation field and the HalftoneHints field."

Oy. In the world of 3D graphics, I've never encountered a TIFF file that =
has GreyResponseCurve, TransferFunction, or HalftoneHints. I also would =
say that it's by no means standard to assume that TIFF files are storing =
NTSC gamma 2.2 for all PhotometricInterpretation=3DRGB images or are =
always linear for grayscale PhotometricInterpretation=3DZeroIsBlack or =
ZeroIsWhite images. Figuring out whether an image is linear or sRGB has =
always been a hit-or-miss challenge and I've never seen consistent =
metadata.

So what should I do with this knowledge?=20

Should I modify my software to write sRGB values to RGB TIFF files, =
unless intended to be linear, in which case output TransferFunction tags =
that probably no reading software will know to look for? And to =
interpret all TIFF RGB files as sRGB values unless they have transfer =
functions that probably no writer uses? (Aside, if I want to write TIFF =
image that's 3 channel x 16-bit of linear values, it seems extremely =
wasteful to output a 65536 x 3 x 2 byte transfer table just to =
communicate that it's linear.)

Or should I just say, water under the bridge, in the real world nobody =
uses these hints so you just have no idea if a TIFF file is meant to =
represent linear or sRGB values unless the author tells you or you know =
they are following some convention (which may differ by user, company, =
or industry)?


--
Larry Gritz
lg@larrygritz.com





--Apple-Mail=_FFB81B22-66DA-49BC-8A16-42399EFFA202
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">I'm =
embarrassed to say that today I stumbled on a statement in the TIFF 6.0 =
spec that had somehow eluded me previously in nearly 30 years of dealing =
with TIFF files. To wit:<div class=3D""><br class=3D""></div><blockquote =
style=3D"margin: 0 0 0 40px; border: none; padding: 0px;" class=3D""><div =
class=3D"">"Be aware that the&nbsp;PhotometricInterpretation value of 0 =
or 1 (grayscale) implies linear data because&nbsp;no gamma is specified. =
The&nbsp;PhotometricInterpretation value of 2 (RGB data)&nbsp;specifies =
the NTSC gamma of 2.2 as a default. If data is written as =
something&nbsp;other than the default,&nbsp;then a GrayResponseCurve =
field or a TransferFunction&nbsp;field must be present to define the =
deviation. For grayscale data, be sure that the&nbsp;densities in =
the&nbsp;GrayResponseCurve are consistent with =
the&nbsp;PhotometricInterpretation field and the HalftoneHints =
field."</div></blockquote><div class=3D""><br class=3D""></div><div =
class=3D"">Oy. In the world of 3D graphics, I've never encountered a =
TIFF file that has GreyResponseCurve, TransferFunction, or =
HalftoneHints. I also would say that it's by no means standard to assume =
that TIFF files are storing NTSC gamma 2.2 for all =
PhotometricInterpretation=3DRGB images or are always linear for =
grayscale PhotometricInterpretation=3DZeroIsBlack or ZeroIsWhite images. =
Figuring out whether an image is linear or sRGB has always been a =
hit-or-miss challenge and I've never seen consistent metadata.</div><div =
class=3D""><br class=3D""></div><div class=3D"">So what should I do with =
this knowledge?&nbsp;</div><div class=3D""><br class=3D""></div><div =
class=3D"">Should I modify my software to write sRGB values to RGB TIFF =
files, unless intended to be linear, in which case output =
TransferFunction tags that probably no reading software will know to =
look for? And to interpret all TIFF RGB files as sRGB values unless they =
have transfer functions that probably no writer uses? (Aside, if I want =
to write TIFF image that's 3 channel x 16-bit of linear values, it seems =
extremely wasteful to output a 65536 x 3 x 2 byte transfer table just to =
communicate that it's linear.)</div><div class=3D""><br =
class=3D""></div><div class=3D"">Or should I just say, water under the =
bridge, in the real world nobody uses these hints so you just have no =
idea if a TIFF file is meant to represent linear or sRGB values unless =
the author tells you or you know they are following some convention =
(which may differ by user, company, or industry)?</div><div class=3D""><br=
 class=3D""></div><div class=3D""><div class=3D""><br class=3D""><div =
class=3D"">--<br class=3D"">Larry Gritz<br class=3D""><a =
href=3D"mailto:lg@larrygritz.com" class=3D"">lg@larrygritz.com</a><br =
class=3D""><br class=3D""><br class=3D""><br class=3D""></div><br =
class=3D""></div></div></body></html>=

--Apple-Mail=_FFB81B22-66DA-49BC-8A16-42399EFFA202--

--===============0508743211==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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