How to find Average CIE L a b values of all Pixels in a Selection

D
Posted By
dtom0352
Sep 12, 2006
Views
838
Replies
13
Status
Closed
Hi,
I want to find Average CIE L a b values of Pixels in a Selection that is more than just a 5×5 array. ie just a general selection shape.

thanks

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

JS
John_Slate
Sep 12, 2006
The "mean" value in the histogram of each channel will show you the average values
D
dtom0352
Sep 12, 2006
That seems to be true for RGB mode, but not in L a b.

Any suggestions.
J
Jim
Sep 12, 2006
wrote in message
That seems to be true for RGB mode, but not in L a b.

Any suggestions.
Doesn’ the histogram show the distribution of pixel values using the current working profile? If so, then you need to set the working profile to Lab. Jim
JS
John_Slate
Sep 12, 2006
Not directly but they can be derived from the Mean values with a little math

To determine the average L value, use the formula: 100 – [Mean รท 2.55]

To determine the average a and b values, use the formula: Mean – 128
D
dtom0352
Sep 12, 2006
Thanks John,
that will do it.

cheers
GA
George_Austin
Sep 14, 2006
John,

In your formulas, to what "mean" values do you refer? The Lab L mean value is not the mean luminosity shown in the histogram. The Lab a and b mean values are not cited at all.

What one could do, however, is to go to the color picker, punch in the mean R,G, and B values from the histogram and read off the corresponding Lab L and a and b values. (This should not be expected to work in reverse, i.e., to get mean R,G,B values from Lab values becuse the RGB gamut is smaller than the Lab gamut).
JS
John_Slate
Sep 14, 2006
I don’t mean to be mean, but I mean the mean values in the histogram, when you scroll the Channel field to Lightness or "a" or "b", know what I mean?
GA
George_Austin
Sep 14, 2006
John,

Clearly, I’m missing something. The only histogram channel mean data I can find are RGB, Red, Green, Blue, Luminosity, and "Colors". By what means does one coax Lab values out of the histogram?
GA
George_Austin
Sep 14, 2006
OK, to answer my own question, switch to Lab mode and then invoke the histogram to get L a and b channel data.
GH
Gernot_Hoffmann
Sep 14, 2006
The relation between R’G’B’ (gamma encoded values)
and Lab is highly nonlinear, therefore mean values
cannot be transformed easily.

One exception: a gray image has C’=R’=G’=B’.
In this case and for G=2.2, C’ is almost a linear
function of L* or vice versa.
This is shown here on top of p.8, the black and the
green curves:
<http://www.fho-emden.de/~hoffmann/a3gencolortest.pdf>

Then we can use L*=C’/2.55 for L*=0..100 and C’=0..255
as an approximation with max. error 5% or so.

Perhaps the OP’s problem can be solved by applying
a very strong Gaussian blur which results in a uniformly colored area. Then one can read the Lab values.
Gaussian blur doesn’t clip, therefore the measurement
should be rather accurate.

Best regards –Gernot Hoffmann
JR
John_R_Nielsen
Sep 14, 2006
Couldn’t you just have the image in Lab mode, and run the Blur > Average filter on the selection? Once you have the color, you could then undo the blur.
GH
Gernot_Hoffmann
Sep 14, 2006
John,

yes, but the Info Palette can show Lab values even
if the image is in an RGB mode.

Besides all these odd mathematical considerations
about mean values, I’m still thinking that Blur
isn’t bad.
It’s obviously correct, assumed that the calculation
for millions of pixels is not affected by severe
rounding errors (strong Gaussian Blur has to be
executed by float accuracy).

Best regards –Gernot Hoffmann
JS
John_Slate
Sep 15, 2006
Couldn’t you just have the image in Lab mode, and run the Blur > Average filter on the selection? Once you have the color, you could then undo the blur.

No

Because that would make too much sense ๐Ÿ™‚

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