# Photoshop General Discussion

Currently Being Moderated

## Luminance Formulae and Red Distortion

### Aug 14, 2012 8:28 PM

Tags:

I'm working on a chart that displays and names a couple hundred color swatches.  I have all of their color data in a table, and I want to arrange them by hue and lightness, so I applied the Rec.709 coefficients to my data.  This arranges my colors into a natural gradient--except for the reds, which have some glaring missplacement.  Any idea why .709 coefficients do this, or what coefficients I should use instead?

Replies
• Currently Being Moderated
Aug 14, 2012 10:55 PM   in reply to Autumnmantis

Your observation is correct, like here in chapter 7:

http://www.fho-emden.de/~hoffmann/gray10012001.pdf

It's the Helmholtz-Kohlrausch effect/phenomenon.

The effect is taken into account in Mark Fairchild's

Color Appearance Models.

Using Lab (CIELab) or even Munsell wouldn't improve the

situation, in my opinion. For me, saturated red/orange

appears brighter than gray or blue in planes of constant

Lightness (Lab) or Value (Munsell).

http://www.fho-emden.de/~hoffmann/cielab03022003.pdf

http://www.fho-emden.de/~hoffmann/munsell15052009.pdf

Best regards --Gernot Hoffmann

|
Mark as:
• Currently Being Moderated
Aug 15, 2012 8:52 PM   in reply to Autumnmantis

Thanks to Prof Hoffman as usual. I am glad he is again contributing to the forum.

|
Mark as:
• Currently Being Moderated
Aug 16, 2012 4:50 AM   in reply to Autumnmantis

Autumnmantis and Lundberg,

thanks for the feedback. In my opinion there are two mistakes:

a) wrong exponent (G instead of 1/G)

b) wrong concept - the ordering sequence does not depend on

gamma encoding.

This formula delivers the CIE(1931) luminance Y in linear coordinates,

specifically for Rec-709 primaries and D65 white:

r=0.2126

g=0.7152

b=0.0722

Y = rR + gG + bB

Gamma encoded values are characterized by an apostroph, but we

have to apply an inverse exponent k=1/G = 1/2.2, because the monitor

applies a transform with exponent G to data (rule of thumb).

R'=R^k

G'=G^k

B'=B^k

Y' = rR' + gG' + bB'

Now let's assume, we have sorted some colors by their luminances:

Y1<Y2<Y3...

How would the gamma encoded numbers be sorted?

Probably exactly  in the same order (I thought I had proved this

mathematically, but who knows):

Y1'<Y2'<Y3'

Therefore no gamma encoding can cure the Helmholtz-Kohlrausch-

"problem" - sorting by perceived lightness (by brightness).

There are other problems - the perception  of a color depends

much on the environment.

Autumnmantis, what exactly is your application?

Best regards --Gernot Hoffmann

|
Mark as:
• Currently Being Moderated
Aug 16, 2012 1:27 PM   in reply to Autumnmantis

Things you might want to read:

http://www.poynton.com/notes/colour_and_gamma/GammaFAQ.html

http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html  Particularly section 9.

You have gamma encoded RGB values, you need to convert those to linear values, then apply the weights to calculate Y.

|
Mark as:
• Currently Being Moderated
Aug 17, 2012 4:07 AM   in reply to Autumnmantis

Autumnmantis,

you're right, my assumption that sorting by linear luminance Y

or - alternatively - gamma encoded luminance Y' should deliver

the same sequence, is probably wrong. Thanks for insisting.

Anyway, there is - in the sense of CIE(1931) colorimetry - only one

correct approach, here for rec.709 and D65:

Convert the gamma encoded file data R', G', B' into data R,G,B

in the linear space X,Y,Z and calculate Y, the true CIE luminance:

Y = r R'^e + g G'^e + b B'^e  with exponent e=gamma=2.2.

The Helmholtz-Kohlrausch effect isn't  part of the CIE colorimetry,

therefore this sorting doesn't deliver a visually correct sequence.

According to Poynton (quoted below):

http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC11

in video technology a linear combination of R',G',B', called

Luma,  is used as a substitute for luminance Y:

The coefficients that correspond to the "NTSC" red, green

and blue  CRT phosphors of 1953 are standardized in ITU-R

Recommendation BT.  601-2 (formerly CCIR  Rec.  601-2).

I call it Rec.  601.

To compute nonlinear video luma from nonlinear red, green

and blue:

This well known formula is often applied to sRGB though it is based

on NTSC primaries and illuminant C whitepoint.

You may try sorting by Luma...

Here's another attempt how to sort colors for special purposes:

http://www.fho-emden.de/~hoffmann/palette30082003.pdf

Best regards --Gernot Hoffmann

|
Mark as:
• Currently Being Moderated
Aug 17, 2012 2:20 PM   in reply to Autumnmantis

Yes 2.2.

Think about 50% gray -- you have a gamma encoded value of 127/255, that should map to a linear value near 18% (reflectance matching 50% perceived lightness).

127/255 ^ 2.2 = 0.216

|
Mark as:
Actions

#### More Like This

• Retrieving data ...

#### Answers + Points = Status

• 10 points awarded for Correct Answers