AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2006

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2006.12.05 15:52 "Grayscale, or is it?", by Joris Van Damme
2006.12.05 17:18 "Re: Grayscale, or is it?", by Bob Friesenhahn
2006.12.05 17:34 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.05 17:45 "Re: Grayscale, or is it?", by Bob Friesenhahn
2006.12.05 18:44 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.05 22:10 "Re: Grayscale, or is it?", by Frank Warmerdam
2006.12.05 20:37 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.05 21:16 "Re: Grayscale, or is it?", by Edward Lam
2006.12.05 21:30 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.05 22:28 "Re: Grayscale, or is it?", by Edward Lam
2006.12.05 22:41 "Re: Grayscale, or is it?", by Jean-yves Le Ridant
2006.12.05 23:13 "Re: Grayscale, or is it?", by Bob Friesenhahn
2006.12.05 23:29 "Re: Grayscale, or is it?", by Phillip Crews
2006.12.06 02:05 "Re: Grayscale, or is it?", by Graeme Gill
2006.12.05 22:56 "Re: Grayscale, or is it?", by Glenn Widener
2006.12.05 23:26 "Re: Grayscale, or is it?", by Toby Thain
2006.12.06 01:58 "Re: Grayscale, or is it?", by Graeme Gill
2006.12.06 04:45 "Re: Grayscale, or is it?", by Edward Lam
2006.12.06 20:56 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.06 22:19 "Re: Grayscale, or is it?", by Graeme Gill
2006.12.06 23:30 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.07 01:28 "Re: Grayscale, or is it?", by Graeme Gill
2006.12.07 07:45 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.06 20:56 "Re: Grayscale, or is it?", by Joris Van Damme
2006.12.06 21:57 "Re: Grayscale, or is it?", by Graeme Gill

2006.12.06 20:56 "Re: Grayscale, or is it?", by Joris Van Damme

Graeme,

Graeme Gill wrote:
> Either we're interpreting "straight", "linear" and "gamma"
differently,
> or perhaps you are confusing the processing applied, with the state
> of encoding ?

That does indeed seem to be a common confusion in this thread.

> > 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.
>
> And of course this equation is acknowledged to be wrong - you can't
> combine gamma encoded values like this to give a correct greyscale.
> To do it properly, you have to turn the values into linear light
> encoding, then weighted sum them, and perhaps re-encode with
> gamma again. The NTSC system adopted the above simply for expedience -
> it's tricky to decode into linear light and back again using vacuum
> tubes - so they compromised on the monochrome reproduction.

It's totally off-topic, but interesting nonetheless, so here's my two
cents...

Things depend on your colour model, or at least they do if you desire to
be consistent.

If you colour model goes as far as to be based on actual physical
properties of light, it's extremely complicated to convert RGB to
"greyscale". You'll have to dig into spectra and whatnot, for all I
know.

If your colour model is centred around CIE L*a*b* as an approximation of
human vision, then to be consistent you need to calculate the Y channel
of XYZ from your (s)RGB values, and from that next calculate a
"greyscale" value. Otherwise, the L* brightness of an RGB value is going
to be different from the L* brightness of the grayscale value derived
from that same RGB value, and that doesn't make any sense.

If your colour model is totally on the other end of the spectrum, i.e.
fiddle with RGB values until you get something pleasing that's fast to
calculate, then the .33R+.5G+.17B formula is as good and as bad as any.
I've seen R, G, and B being averaged with equal weights, too, and that's
no worse nor better. You're perfectly right of course in suggesting that
it doesn't make much mathematical sense to calculate a weighted sum of
non-linear values, but in this model there is no such thing as 'sense'
anyway, mathematical or otherwise, it's merely about doing something
that looks to give acceptable results and is fast enough.

Of course, while all colour models are created equal, and all are said
to be the textbook standard, we are allowed to have a personal
preference. ;-)



Best regards,

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