Luminance quantified

P
Posted By
Phosphor
Sep 25, 2003
Views
490
Replies
11
Status
Closed
"Luminance" in Photoshop’s Lab color space clearly gives more weight to green than red and more to red than blue. But the weighting factors are not the same as those Photoshop uses for "Luminosity".

Photoshop uses 0.30, 0.59, and 0.11 (exactly) in calculating luminosity from red, green, and blue color values respectively.

Luminance calculations are different. Apart from being on a 0-100 scale rather than 0-255 (as Luminosity is), Luminance seems to use weighting factors in the vicinity of 0.314, 0.512, and 0.174 for pure red, green, and blue. I realize that Lab uses a nd b channels for chromatic data and not R,G,B, but that doesn’t prevent you from establishing the colors in RGB and observing the Lab parameters corresponding to those settings.

It’s hard to nail this down because sampling data is digitized. It’s not even clear that the weighting factors are constant over the full color value range, because the plotted points of Luminance vs color value are quasi-linear—There is slight bowing of the curves at low color values which may or not be merely digital quantization.

Can someone throw more light on how Photoshop’s Lab Luminance parameter for a given pixel relates to the RGB color values for that pixel?

George

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

P
Phosphor
Sep 25, 2003
Luminosity is an approximation.

Luminance is an absolute (CIE L*). The conversion factors depend on the exact color profile that you are converting from. But the transform for Luminance is not just a simple set of weights.

If you want to know how they relate, you’re going to have to learn a little color science to convert RGB to CIE XYZ, then CIE XYZ to CIE LAB.
P
Phosphor
Sep 25, 2003
Chris,

"…Luminosity is an approximation…"

An approximation of what? Do you mean of Luminance?

That would make some sense (after translating Luminosity’s 0-255 scale into Luminance’s 0-100 scale, in that the plot of Luminance vs color value in any one of the three RGB channels is a somewhat warped straight line that the Luminosity plot which is strictly linear approximates (very well for red, but with more divergence between blue and green than you’d expect by eyeballing the curves.)

….The conversion factors depend on the exact color profile that you are converting from". Yeah, I can believe that!

"…If you want to know how they relate, you’re going to have to learn a little color science to convert RGB to CIE XYZ, then CIE XYZ to CIE LAB…"

Now that is an all-or-nothing bit of advice that will surely lead to nothing for lack of time, inclination, energy, smarts, etc. I hope to circumvent the alphabet and a two-year leave-of-absence at a monastery and get adequate user’s insight into these every-day parameters (which we all mouth in ignorance to varying degrees). In my most optimistic moments, I feel I can do so by going no further than Photoshop’s own color picker, varying the RGB inputs while recording the effects on Luminance as it changes numerical value right there in the color picker window. Just looking for a little guidance from someone who, perhaps, has done time as a color science recluse.

George
GH
Gernot Hoffmann
Sep 25, 2003
George,

the conversion is very complex. The complete set of equations is here:

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

Sorry, 1.1 MByte. I thought it might be helpful to illustrate the CIELab color space.

Patterns were designed in CIELab, converted to sRGB, packed in PDF, placed in sRGB PhS doc and measured as CIELab values: not even round off errors.

"exact color profile" means working space.

Best regards –Gernot Hoffmann
P
Phosphor
Sep 25, 2003
Gernot,

I stand in total awe at your magnificent work. I am also in awe of the effort it would take for me to understand it. So, let me pose a different challenge:

You are making a presentation to a roomful of very experienced PS users who are technically savvy but generally resistant to mathematics. They want to know the difference between Luminance and Luminosity. They don’t want the question shrugged off or dismissed lightly. It bothers them to encounter the terms on a daily basis and yet be so clueless. What do YOU tell them?

George
GH
Gernot Hoffmann
Sep 26, 2003
George,

my tutorials are not so much intended for "average" PhS users.

A simplified explanation:

Pre-distorted values R´G´B´ are transformed into linear light space RGB ("Gamma-correction")

(1) C=C´^gamma

CIE values XYZ are calculated by a linear operation

(2) X=a11*R+a12*G+a13*B
(3) Y=a21*R+a22*G+a23*B
(4) Z=a31*R+a32*G+a33*B

The coefficients depend on the primaries of the working space.

Y is the CIE luminance channel, which is obviously called Luminosity in PhS nomenclature. Roughly, for all spaces:

(5) Y=0.3*R + 0.6*G + 0.1*B

XYZ are converted to CIELab in a three stage process:

Apply a white point shift from sRGB/D65 to D50.
Apply the so called Bradford correction for adaptation. And now the most essential step:

(6) L* = Y^(1/3) (simplified)

This means: Lab luminance L* depends nonlinearly on XYZ luminance Y.

Take (1),(3) and (6): this shows what mainly happens.

The practical consequences for PhS users (here L means L*): Don´t interpret Lab, but use Lab for some calculations like: Sharpen only in L-channel
Improve contrast only in L-channel
…..

CIELab is the so called Profile Connection Space for ICC profiles. RGB –Lab–CMYK

Best regards –Gernot Hoffmann
P
Phosphor
Sep 26, 2003
Gernot,

What is the rationale for step 6(L* = cube root of Y)?

George
GH
Gernot Hoffmann
Sep 26, 2003
George,

do you mean "rounded integer" by rationale ? (my lack of understanding English).

The calculations can be done only in float for normalized values R,G,B=0…1, Y=0…1 and L*=0…1. The results R,G,B are multiplied by 255 and rounded.
The results Y,L* are multiplied by 100 and rounded.

Best regards –Gernot Hoffmann
GH
Gernot Hoffmann
Sep 26, 2003
George,

the dictionary helps .. "rationale" means the "reason".

In a certain test condition – a dark room and two projected slightly different gray patches – it was observed that the two patches are just distinguishable if the difference in L* is a constant small value: deltaL*=1 (for L*=0..100).
This is extended for the Euclidian distance in Lab: deltaE=1 is the distiguishable threshold. (originally the Weber-Fechner Law, using the Lab power law as an approximation of a logarith- mical formula).

There are many objections. Especially: it´s true only for adaptation to the mean luminance in the test environment. It´s considerably wrong for dark patches and light adaption. This is easily shown by test patterns:
<http://www.fho-emden.de/~hoffmann/caltutor270900.pdf> On page 5 one can distinguish dark grays, on page 6 they look the same.

CIELab is the state of the art, used in all ICC profiles. Just an attempt to create an approximation
of a "perceptually uniform" color space with not too much computational effort. In reality far from being perceptually uniform.

Best regards –Gernot Hoffmann
P
Phosphor
Sep 27, 2003
Luminosity is NOT the same as luminance.

Luminosity is an approximation to luminance, made from weights applied to the gamma encoded values. The conversion uses fixed weights instead of depending on the profile. This is very similar to the way YCrCb calculates the Y value (different from CIE Y).

The cube root (plus an offset and a slope limiting function that we’re leaving out for simplicity sake) is an approximation to human visual sensitivity to light. This makes the L* values very close to perceptually uniform. (more so than Gernot gives it credit for)
GH
Gernot Hoffmann
Sep 27, 2003
Chris,

I was never sure about the question, whether the Luminosity is calculated in PhS by fixed weights (Rec.709)
or by weights for the actual working space. Both methods would work as an approximation, though green
is IMO always too dominating.
Actual weights mean exactly the Y-channel in CIE XYZ.

The weight factors for Y in YCbCr (e.g. for JPEG) are different. These are mostly applied to not gamma corrected
values R´G´B´ and I am sure that these weight factors are not used in PhS.

The "perceptual uniformity" was discussed often, a further discussion wouldn´t help much.
CIELab is indeed very useful for many purposes (besides being the standard for ICC), e.g. for the creation
of perceptually "balanced" palettes for colors in maps.

Best regards –Gernot Hoffmann
P
Phosphor
Sep 27, 2003
Gernot and Chris,

Gone fishin’ for the weekend—not literally but I might as well be. (My friends and family have their own ideas about what is fun). But while I’m angling (figuratively), you’ve given me lots of fun things to ponder.

George

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Related Discussion Topics

Nice and short text about related topics in discussion sections