Histogram, meaning of RGB, Luminosity and Composite channels?

FF
Posted By
Francesco_Fantauzzi
May 13, 2007
Views
1276
Replies
12
Status
Closed
In the histogram, any idea what the RGB and Luminosity channels show? May be RGB is computed as the sum of R, G, and B? Or some linear combination of them? Luminosity looks to me the same as L in Lab color space, isn’t it?

And what about the Composite channel in the histogram in a Lab mode picture?

Thanks.

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!

GA
George_Austin
May 14, 2007
I don’t want to come off sounding like an authority on this subject, which I’m not, but I’ve asked myself the same sort of questions you raise, and here’s how I see it:

Luminosity in Photoshop is 0.3R + 0.59G + .11B. The channel weighting factors add up to 1.0, precisely because the result needs to be 255 when all three RGB channels are each at their maximum (255).

These weight assignments were derived empirically from testing thousands or perhaps tens of thousands of humans to see when their subjective perception of "brightness" matched reference values, as the physical channel intensities were varied. It is a contrived parameter in that relative response ratios are not constant over the entire intensity range.

The weights chosen are a compromise to keep things conceptually simple and are good enough for Photoshop purposes but scientifically inexact, increasingly so at the extreme ends of the intensity range. Other weights may be used in other applications or scenarios but no single set of weights will apply over the whole intensity range.

The L in Lab is derived as that color space’s third component, the separation into chromatic (a and b channels) and non-chromatic (L channel) is Lab’s very reason for being. The Lab L channel is called "Lightness" to distinguish it from "Luminosity" to which it is related but by no means equivalent. "Luminance" is sometimes used but over objections that that term implies intensity (an exact physical measure of irradiant power per unit area).
FF
Francesco_Fantauzzi
May 16, 2007
Thanks George. Apparently you are some authority, given you are the only one who tried to give an answer 🙂
B
Bernie
May 17, 2007
It’s not worthwhile to post something simply to repeat what George already said…
FF
Francesco_Fantauzzi
May 17, 2007
Right.

What about the Composite channel in the histogram in a Lab mode picture?
GA
George_Austin
May 18, 2007
"…And what about the Composite channel in the histogram in a Lab mode picture?…"

The LAB composite histogram is a strange duck. It is like the RGB histogram in that the contributing channel components are not distinguished. L, a, and b channels having the same value are counted together. Counting pixel sites in that manner may make some sense in RGB, but in LAB it makes no sense at all.

Further, to make things more confusing, 0 to 100 is the L range, -128 to +128 the a range, and -128 to + 128 the b range. To accomodate these ranges in a 0 to 255 histogram range, the L values are multiplied by 255/100 and the a and b values are increased by adding 128 to them.

Unless someone else can show why the LAB Composite Histogram is of any use at all, I suggest ignoring it.
BJ
Bill_Janes
May 18, 2007
I appreciate George Austin’s contribution to this thread, and it caused me to do a bit of thinking and research. I think that the luminosity weighting factors that George mentions (Y’ = 0.299 R’ + 0.587 G’ + 0.114 B’) are from the Rec 601 luma <http://en.wikipedia.org/wiki/Luminance_(video)> function, which uses the chromaticities (primary colors) of standard television, which I think are those of sRGB.

If you use a different color space with different primaries, I think that the weighting factors would have to be changed.

James Palmer has published a useful
Radiometry and photometry FAQ <http://www.optics.arizona.edu/Palmer/rpfaq/rpfaq.htm>, which includes information on how the weighting factors are applied. The weighting factors are derived from the CIE luminosity function (
CIE (1924) Photopic V(&#955;) <http://cvision.ucsd.edu/database/data/lum/vl1924e.txt>), which is published on the UCSD web site. This site also contains updated luminosity functions, which are more accurate. These coefficients are normalized for green light (555 nm). If one is dealing with a monochromatic value, the required coefficient can be applied directly, but if a spectrum of colors is involved integration must be used (for those who hate calculus, you can merely sum the area under the curve representing the desired range of wavelengths).

According to the above analysis, different weighting factors would be required for AdobeRGB and ProPhotoRGB. I do not know if Photoshop takes this into account and would appreciate hearing from George and others.
GH
Gernot_Hoffmann
May 18, 2007
George,

probably you remember the time when we were
starting discussions about luminance and gray-
scale conversions, some years ago.
In this sense my post is not a correction but
an attempt to enlighten the background, to my
best knowledge at present.

Bill, thanks for your input as well.

Popular grayscale conversion formulas
are based entirely on CIE (1931) colorimetry,
measured for only 17 British observers by
Wright and Guild. The relevance of these
data was later confirmed and a little
corrected by Stiles.
Best introduction:
R.W.G.Hunt, Measuring Colour.

Using any set of primaries and a white
point WP, it is possible to express R,G,B
by unique CIE tristimulus values X,Y,Z,
where R,G,B and Y are normalized for the
range 0 to 1:

X = a11*R + a12*G + a13*B
Y = a21*R + a22*G + a23*B
Z = a31*R + a32*G + a33*B

Y is the eqivalent for luminance.
X and Z don’t contain any information
about luminance (a ‘dirty’ mathematical
trick).

Two sets of weights are common,
others can be calculated easily (e.g. for
AdobeRGB):

1. NTSC primaries and illuminant C WP 6774 K
Y = 0.299*R + 0.586*G + 0.114*B

2. Rec.709 primaries and D65 WP 6500K.
Together with a specific tone reproduction
curve this is sRGB
Y = 0.213*R + 0.715*G + 0.072*B

Aha, no.1 is the magic formula, but no.2
would be better for sRGB.
Each formula should be applied to linear RGB
values, whereas file data are gamma encoded.
In the past these weight factors were applied
to gamma encoded values without linearization.

For the practical application we encounter two
difficulties:
a) a formalistic grayscale conversion delivers
images with lacking contrast. How to deal
with this problem in advance to the conver-
sion(!) is nicely described by Dan Margulis,
Professional Photoshop.
b) Sorting colors by calculated luminance does
not create monotonously increasing percep-
tual luminance palettes.
This is known as Helmholtz-Kohlrausch-Effect:
Saturated colors appear brighter than
indicated by CIE luminance.

Results, including the H-K-Effect, are shown
here:
<http://www.fho-emden.de/~hoffmann/gray10012001.pdf>

In either case, we are dealing here with photo-
metry, which contains besides physical inten-
sities the human sensitivity functions.

Best regards –Gernot Hoffmann
GA
George_Austin
May 18, 2007
Now there IS an authority (Gernot)!!

Only 17 British observers? Really?

Bill,

The important definition of luminosity for Photoshop users is the one Photoshop has adopted. Create a monochromatic swatch using any set of RGB values, calculate its luminosity as .3R+.59G+.11B, select the swatch, bring up the histogram for the swatch, and compare your calculated luminosity with the value appearing in the histogram for the luminosity channel. They will ALWAYS agree, no matter what the RGB values are and no matter what color space is in use.
BJ
Bill_Janes
May 18, 2007
Now there IS an authority (Gernot)!!

Yes, it is always a pleasure when a true color scientist such as Prof. Dr. Hoffmann enters into the discussion.

The important definition of luminosity for Photoshop users is the one Photoshop has adopted. Create a monochromatic swatch using any set of RGB values, calculate its luminosity as .3R+.59G+.11B, select the swatch, bring up the histogram for the swatch, and compare your calculated luminosity with the value appearing in the histogram for the luminosity channel. They will ALWAYS agree, no matter what the RGB values are and no matter what color space is in use

George,

I performed the experiment you suggested and confirmed your prediction. I chose an RGB value triplet of 43, 38, 130 in sRGB and in ProPhotoRGB. Of course, the appearances of these swatches on the screen were quite different (the sRGB swatch appeared much darker), but I got a luminance of 50 in both cases.

This would indicate to me that Photoshop is using the Rec 601 luma function (NSTC) for all colorspaces. Prof Hoffmann has told us that the Rec 709 primary weights(Y = 0.213*R + 0.715*G + 0.072* B ) would be more appropriate for sRGB. Also these are being applied to the gamma corrected values, and not the linear values as Prof Hoffmann suggests in the referenced PDF. It seems as if Photoshop’s lumonosity calculations are not optimized for the color space, but apparently no one has complained as yet.
GA
George_Austin
May 18, 2007
Bill,

Good! We’re on the same page.

Regardless of what the most appropriate luminosity might be, we need to bear in mind the luminosity Photoshop actually uses.

George
FF
Francesco_Fantauzzi
May 18, 2007
Thank you all folks. Now I just need to find out what variant my camera uses to show the histogram on display, so I will understand why pictures the camera histogram reports properly exposed then turn out to have blown out highlights when opened with Adobe Camera RAW or Lightroom.
BJ
Bill_Janes
May 19, 2007
Thank you all folks. Now I just need to find out what variant my camera uses to show the histogram on display, so I will understand why pictures the camera histogram reports properly exposed then turn out to have blown out highlights when opened with Adobe Camera RAW or Lightroom.

Most cameras that show only one view with all channels combined show the luminosity histogram. Some show only the green channel, since green is the most important component of a luminosity histogram. Since the blue contributes very little to the luminosity value, the blue channel can be completely blown and it will not show on the camera histogram. That is why most of the higher end cameras show the red, blue, and green channels separately.

It seems to me that a camera having only a composite histogram should show the RGB histogram similar to that in Photoshop’s default. In that case, any blown channel will be evident.

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!

Related Discussion Topics

Nice and short text about related topics in discussion sections