AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2006.12.05 15:52 "[Tiff] Grayscale, or is it?", by Joris
2006.12.05 17:18 "Re: [Tiff] Grayscale, or is it?", by Bob Friesenhahn
2006.12.05 22:56 "[Tiff] Re: Tiff Digest, Vol 31, Issue 3", by Glenn Widener
2006.12.05 23:26 "Re: [Tiff] Re: Tiff Digest, Vol 31, Issue 3", by Toby Thain
2006.12.06 01:58 "Re: [Tiff] Re: Tiff Digest, Vol 31, Issue 3", by Graeme Gill
2006.12.06 20:56 "[Tiff] Re: Grayscale, or is it?", by Joris
2006.12.06 21:57 "Re: [Tiff] Grayscale, or is it?", by Graeme Gill
[...]

2006.12.05 22:56 "[Tiff] Re: Tiff Digest, Vol 31, Issue 3", by Glenn Widener

> <>From: "Joris" <joris.at.lebbeke@skynet.be>
> Subject: [Tiff] Grayscale, or is it?\
>

> <>Anyone has any advice on this matter?
>
>
>
> >
>
Some, briefly.

I'm forever having trouble with grayscale in TIFF, except that now I really need to resolve it and make a final descision.

The TIFF spec, in "Section 4: Grayscale images" does not contain a good definition of grayscale. However, on page 73, "Comments for TIFF writers", in a discussion of gamma, it says "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."

We (SwiftView) used to obey the spec regarding a default gamma of 2.2. But we found no one else that does, so we can't either, and we changed the default to a straight linear device RGB. "No one else" includes at least.Microsoft Office Document Imaging and Paint Shop Pro 6.

Now, what is linear data? Linear to what? What is grayscale, for that matter?

Linear means literally read, write and send the values to your display unchanged - "linear device values". If you don't know what the correction is, or haven't been told, don't do any.

I see three possibilities.

  1. Greyscale is R=G=B. I think this interpretation is consistent with most common practice. It is also consistent with the LibTiff RGBA interface implementation, in that this just sets R, G, and B, to the greyscale read from the TIFF. It is however a clear violation of the above quoted remark on gamma.

The standard conversion from RGB to gray, documented in the textbooks, is grey level = .33R+.5G+.17B. So a unitary conversion back to RGB is fine. Off the cuff, I would convert greyscale to RGB, apply whatever color correction you wish, then convert back. But then I'm not a color space expert. Converting gray levels 1:1 to the intensity component of a color space that has an intensity component makes perfect sense to me.