What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Alternatives to get Light Reflectance Values from a given photograph.


omeride

New Member
Messages
4
Likes
0
Hi everyone, Homer here, surfing the web and searching for some luminosity help with Photoshop.

Im exploring alternatives to get Light Reflectance Values from a given photograph.

I always get LRV values for each colour independently (when I can layer them out from an artwork) matching them to the NCS colour fan.
From NCS, every colour has a specific LRV number, so then I calculate the especific area that colour covers within the size of the total of the artwork and then do a % calculation
to get an overall LRV value of the entire artwork.

Thats an easy thing to do with digital graphics/artworks when you can individualize each colour independently (usually no more than 6, no gradients, no shadows, etc) just plain colours.

Now Im trying to do the same with photographs where shadows, highlights, colour blends and gradients are part of any image hence almost impossible to individualize each colour and its areas.

Does anyone know how to get the same approach as the described but for photographs? I was thinking about Photoshop Histogram etc, but still I can't figure out a feasible/consistent procedure.

Any help would be much appreciated.
Regards,
 
Hi @omeride
It is not hard to have Photoshop effectively do calculations or the RBG channels and compute an overall luminosity number as a gray-tone image.
So, the first question is, what do you want—a gray-tone image computed from RGB values to represent Light Reflection? Or do you need something finer, such as the overall reflectance of the image?
In either case, we just need the equation to convert from RGB to Reflectance.
Note, however, that I have seen several different calculations for reflectance online.
One is using a simple formula with RGB numbers.
Another is using Luminosity from Lab space and a calculation.
Photoshop natively can easily calculate image luminosity as it uses the formula: Luminosity = 0.3 * R + 0.59* G + .11* B

The other point is we need to know which RGB color space we need to use in the calculations. The equation I just gave would yield different Luminosities for different RGB color sapces as wider gamut color spaces use smaller color numbers for the same physically seen color.

I am pretty sure we can help you out. Just need some more clarification to put something together.
I hope this is a helpful start for a discussion.
John Wheeler

PS - If you could point me to an online link that might give the conversion equations, that would be a good start.
 
Hi @omeride
It is not hard to have Photoshop effectively do calculations or the RBG channels and compute an overall luminosity number as a gray-tone image.
So, the first question is, what do you want—a gray-tone image computed from RGB values to represent Light Reflection? Or do you need something finer, such as the overall reflectance of the image?
In either case, we just need the equation to convert from RGB to Reflectance.
Note, however, that I have seen several different calculations for reflectance online.
One is using a simple formula with RGB numbers.
Another is using Luminosity from Lab space and a calculation.
Photoshop natively can easily calculate image luminosity as it uses the formula: Luminosity = 0.3 * R + 0.59* G + .11* B

The other point is we need to know which RGB color space we need to use in the calculations. The equation I just gave would yield different Luminosities for different RGB color sapces as wider gamut color spaces use smaller color numbers for the same physically seen color.

I am pretty sure we can help you out. Just need some more clarification to put something together.
I hope this is a helpful start for a discussion.
John Wheeler

PS - If you could point me to an online link that might give the conversion equations, that would be a good start.
Thanks John for your message.
What I need is the overall reflectance of any given photo related to its physical dimensions.(qty of colour (qty of light) per area covered by them)
My method is using LRV numbers from NCS colours, whatever the photoshop procedure might be, I must stick to NCS colour chart and the LRV values from their colour palette.

Thanks
 
Hi @omeride
I think I found a source of information that provides the equation needed and also considers color space/modes.
The formal is based on the Lab color space and an equation using just the L value. The equation is

LRV = (((L+16)/116)^3)*100 results in a percentage number representing LRV

Here are the steps to make this work
- Change the image to a 16-bit image for accuracy in the math
- First, convert the image from a known color space to Lab Color Space (mode)
- Create a new Layer above set to pure white (L=100 a=0 b=0) and set blend to Multiply (this zeros out any color).
- Merge these two Layers so you have a pure L channel image
- Create a new Layer with the Value set to L=86.21 a=0 b=0 and set to multiply (this divides L by 116)
- Merge these two Layers
- Create a new Layer with the Value set to L-13.79 and the blend to Linear Dodge (Add). This adds the value of 16/116
- Merge these Layers back down to one Layer
- Duplicate the remaining Layer twice and set both of the new Layers to a Blend of multiple (this takes the prior values to the cubed power)
- Merge these three Layers down to one Layer, and now you have an image Layer with L values that are now converted to LRV
To average these over the whole picture, you can use the Filter Blur Average, which averages all the LRV values for the whole image.

I tried this out by by testing some NCS color conversions at https://www.e-paint.co.uk/search-lrv.asp
to create some sample NCS colors that showed their LRV values, and I also used the website https://ncs.to/lab/ncs-s-4040-r80b/
To convert the NCS numbers to Lab. I used those Lab numbers in the abovementioned process and compared the result with the LRV value in the first link.
They came out reasonably close.

I hope this gives you a starting point and we can continue the discussion as well if you have questions or adjustments are need
John Wheeler
 
Hi @omeride
I think I found a source of information that provides the equation needed and also considers color space/modes.
The formal is based on the Lab color space and an equation using just the L value. The equation is

LRV = (((L+16)/116)^3)*100 results in a percentage number representing LRV

Here are the steps to make this work
- Change the image to a 16-bit image for accuracy in the math
- First, convert the image from a known color space to Lab Color Space (mode)
- Create a new Layer above set to pure white (L=100 a=0 b=0) and set blend to Multiply (this zeros out any color).
- Merge these two Layers so you have a pure L channel image
- Create a new Layer with the Value set to L=86.21 a=0 b=0 and set to multiply (this divides L by 116)
- Merge these two Layers
- Create a new Layer with the Value set to L-13.79 and the blend to Linear Dodge (Add). This adds the value of 16/116
- Merge these Layers back down to one Layer
- Duplicate the remaining Layer twice and set both of the new Layers to a Blend of multiple (this takes the prior values to the cubed power)
- Merge these three Layers down to one Layer, and now you have an image Layer with L values that are now converted to LRV
To average these over the whole picture, you can use the Filter Blur Average, which averages all the LRV values for the whole image.

I tried this out by by testing some NCS color conversions at https://www.e-paint.co.uk/search-lrv.asp
to create some sample NCS colors that showed their LRV values, and I also used the website https://ncs.to/lab/ncs-s-4040-r80b/
To convert the NCS numbers to Lab. I used those Lab numbers in the abovementioned process and compared the result with the LRV value in the first link.
They came out reasonably close.

I hope this gives you a starting point and we can continue the discussion as well if you have questions or adjustments are need
John Wheeler

Hi John, thank you so much for your time and help with this.

Im trying to test your recommendation but somehow Photoshop does not me allow to use numbers with commas like 86.21 or negatives like -13.79
Am I doing something wrong? cant proceed because of it!
Working with a generic photo in a 16bit lab colour mode.

Yes e-paint website Is my reference for ncs too.

Thanks again

1731580523900.png
 
Hi John, thank you so much for your time and help with this.

Im trying to test your recommendation but somehow Photoshop does not me allow to use numbers with commas like 86.21 or negatives like -13.79
Am I doing something wrong? cant proceed because of it!
Working with a generic photo in a 16bit lab colour mode.

Yes e-paint website Is my reference for ncs too.

Thanks again

View attachment 147954
No problem @omeride. I am learning something as well. I had a typo in my prior post, and the number to use to add is L=13.79. Not a negative number
There is a way to fine tune the numbers between integer numbers of Lab space yet you could start by using 86 instead of 86.21 and also 14 instead of 13.79 to give it a try.
I am going to double-check the internal math when doing blends in Lab mode to make sure it is a pure multiple. I assumed PS was multiplying L numbers directly, yet it's possible it is doing an internal conversion to RGB and then back to Lab. If my original assumption is incorrect, I would need to modify the steps to ensure good accuracy. I will get back to you later today.
 
Hi @omeride
I am going to hopefully make this a bit easier for you.
First, I did verify that the Multiply Blend in Lab mode of Photoshop does directly multiply Lab values, so my assumption was correct for the formula, yet wanted to double-check
Second, rather than writing up a technique to create specific 16-bit values (which the PS Color Checker does not support), I am attaching a PSD file to this post that has two Layers, one for each needed value. The details are in the Layer Label. The PSD file is in Lab mode 16-bit and ready to go.
Here is a screenshot of what is in the PSD file. You can color sample from these two layers and use those to fill the layers in the PSD file you are using to create the LRV image.

Screenshot 2024-11-14 at 12.03.36 PM.jpg

Let me know if you have any issues, and we can work through them.
Also, note that the 16-bit lab number is based on 15-bit as Photoshop only supports 15 bits of resolution 0-32768 when you check the info panel. FYI
John Wheeler

PS—As an aside, I created my own 16-bit Gray Scale Color Picker quite a while ago by programmatically creating a data file external to PS that contained all 2^16 possible gray values and reading that into Photoshop using the special "Photoshop Raw" format. There were some minor pushups when reading it in, so I decided it was easier to provide the two Layers you can color-pick directly.
I cant seem to attach the PSD file (pilot error probably) so here is a Dropbox Link: 16 bit value Layers for LRV Caluculations
 
Last edited:
Thanks John again!
PS worked pretty fine now with your PSD file and guidance, got all the layering done and everything.

The next step for me is to have the Overall LRV number of the entire image.

If I proceed using my original approach with vectors, I can easily individualize every single colour, get their colour area (in sq mm) do rule of three with LRV numbers from NCS for each colour, then a % calculation, to finally get the overall NCS of the image.

This is simple process with just six plain colours, but for a photo processed like below, Im sure there will be thousands of colours, and areas of them.

1731617334401.png

Do you think It would be possible to get the LRV number of the entire thing following the described procedure?
If that's the case, how can I get the colours on this photo (a colour list maybe?) and their areas (in sqmm)?

If not, any alternative?
 
Hi @omeride
I believe you can get what you want, yet I think you would need a Photoshop Script to be productive. I will describe how it can be done and the limitations.
First of all, if for the whole image or a selected area of an image, you can use the average blur filter to get a single value for that area.
So the key would be how to select just and only just the colors you want one at a time and that all of the colors would add up to the entire area of the image (nothing left out).

So here is a conceptual approach.
First, this has a limit to 256 colors

1) Convert the entire RGB image to an Indexed Color image. The max colors is 256 yet PS will automatically create that color table just by converting to Indexed Color
2) You can access and save this Color Table at the bottom of the Mode command:
Screenshot 2024-11-14 at 2.37.33 PM.jpg

3) You save the color table to a location you specify
4) Then you can load this color table as a Swatch Group
5.5) With the selection made, then you make visible the LRV gray tone Layer
5) You use the command Select > Color Range with no fuzziness and no antialias and click on the first color swatch. This will select all the pixels in the image of that one of 256 colors.
6) Then you use the Image > Analysis > Record Measurements (note you have to previously set up the options of what you want to record yet one of the options will be to record how many total pixels show up in that selection
7) You turn off the gray tone Layer and then you loop through all of the swathes in the color table, looping from #5 to #7
8) At the end of this, you can save all of the recorded measurements as a Text File, which can also be imported into an Excel file.

Now, I did not provide the detailed step-by-step instructions, so you would have some homework here, as well, as it requires in addition scripting.

I just wanted to share a feasible way to get the desired results within the limitation of 256 unique colors. If you need a higher number, it may require saving the image file and processed
externally.

I hope this gives you a path to consider
John Wheeler
 

Back
Top