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

Member
Messages
6
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
 
Hi John, thank you so much again for your fantastic help with this.
I just followed the whole process and I realized how tedious and complex it is doing all the colours individually, still on point I must say, but I took some time to elaborate a moire generic approach using "average" command.

Please check below and let me know what you think, Im doing the whole process from the top.
1- Selected any random landscape photo, Change to 16 bits, lab colour, and choose a random area (cyan square)

1732365742000.jpeg

2 - Layer pure white (L=100 a=0 b=0) / multiply / Merged
Layer L=86.21 a=0 b=0 / Multiply / Merged
Layer L-13.79 / Linear Dodge (Add) / Merged
Duplicated remaining both as multiply / Merged

1732365820031.jpeg

3 - Blur - Average to the area within the cyan square, and got the NCS equivalent (and its LRV) using Lab numbers.

1732366010519.jpeg

4 - Then proceed with Blur - Average for all the partial squares diagonally to cover the majority of tones/colours variations of that specific cyan area. from a to f
and got the Lab from all of them. All the squares are known areas in sqmm.

1732366088212.jpeg

5- Just took a and f as an example, got the equivalent NCS/LRV, and thats when I started to

1732366247432.jpeg

6 - As you mentioned, the command Blur-Average provides the average colour of the blurred area (whose colours were visual altered during step 2)
I just need to confirm how representative each section's average colour is, as after doing all the layering (step 2) the colours have changed visually.

I mean, how accurate is the resulting NCS colour (after all the steps) if I compare them to the Original (before any changes) photograph?
Below resulting NCS for a and f compared to the original photo.

1732366528238.jpeg

This process Ivetryed is a mixture between my original procedure and yours, since I need to play around colour areas in a reliable way (programming, scripting and playing
around the entire colour count of a pic is not an option at this moment) and the colour areas are estimated geometrically as shown.

Thanks!

1732366235668.jpeg
 
sorry I pressed Reply by error and post got up and I cant edit it.

- "5- Just took a and f as an example, got the equivalent NCS/LRV"
- Avoid the last screenshot.
 
Hi @omeride
First, let me say I made one mistake in my approach, which I typed in my accident. In the first few steps, I was converting the Lab image to our L (or grayscale). I said to use the Multiply Blend, yet that should have been Color Blend. My apologies.
When testing it with the original approach I used, the multiply blend, the correct LRV value was still found. However, I cannot attest that it will work in all cases. At the bottom of this post, I duplicated the instructions with the correct Blend of Color for that step.

To verify the equation, I took the Lab numbers for a specific NCS Color, ran them through the PS process steps below, and arrived at the same LRV value for that color. I only did this for NCS 4010-G10Y, so it was not an exhaustive test.

I could not follow your instructions exactly from your prior post. Yet if you are averaging the colors of the original image, using those Lab numbers for an equivalent NCS color and its LRV value then that sounds like a fine approach.

The only possible question that came to my mind is if you should be averaging the original image or averaging the LRV image to get you answer. At this point, I am not sure which one wold be more accurate yet I believe you would end up with different answers.

Let me know how else I can help
John Wheeer

Here are the corrected steps below with the change put in Bold font

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 Color (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 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
 

Back
Top