• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How does Photoshop calculate Lab values?

Engaged ,
Dec 06, 2024 Dec 06, 2024

Copy link to clipboard

Copied

In the Color Picker tool, Photoshop presents the Lab values of colors if you type in the RGB or HSB values. 

I doubt Adobe goes to one of the color conversion websites to get the Lab values. Does anybody know the formula they use to calculate it?

 

Scott

TOPICS
Windows

Views

674

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

Here's how it all works, how color management works.

 

This is the relationship between Lab and all other color spaces:

 

profiles.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

Do you know whether Device Link Profiles also convert the data to Lab and back (or rather to the new target space)? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

There is no Profile Connection Space (PCS: XYZ or Lab) in DeviceLink profiles, the two profiles are directly connected/linked together as a colour lookup table. For CMYK, this allows the preservation of primary values such as 0cmy1-100k, secondary overprints 0c100m100y0k, tertiary grey balance, but also possibly using different tone response curves, ink limiting, ink saving etc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

quote

It was not the correct answer to *my* question. The correct answer to *my* question needed to contain the formula Adobe uses to convert RGB values to Lab in its color picker. I didn't ask about color spaces or why Lab is the best or any of that stuff you wrote about. Maybe someone else asked you about those things, but I sure didn't…The color picker doesn't ask about sRGB or Adobe RGB or ProPhoto RGB, etc. It just says RGB. 

By @scotwllm

 

That’s because the color picker always presents values within the working space/document color space, and that’s why the others were asking. (And by the way, the color picker is aware of some other color spaces even if they aren’t explicitly labeled; that’s why it has those gamut warning icons.)

 

I think I see what’s really going on here, and you helped clear things up a few replies down where you finally, finally said:

 

quote

They are sRGB values…I'm not attempting to compare colors from different color spaces. What do you think I am, a Communist or something?

By @scotwllm

 

That was the piece we were all missing for so long. You’re only working in sRGB.

 

If that had been said earlier, there wouldn’t have been so much questioning. The problem is that it sounded like you were asking a generic question that could apply in all cases, if so including the color space info would be critically important, and that’s why we were all asking about it. We know it won’t work in all cases.

 

But now that you finally mentioned that you’re “not attempting to compare colors from different color spaces” then it’s clear why you believe a straight conversion table would work.

 

And, maybe for your purposes a simple table does work, and if you’re happy with that then that’s great. But the reason for all the concern is that we all know that solution doesn’t scale (e.g. to situations where other color spaces are involved). And also because it is important to know that Photoshop color conversions go through Lab and must account for color spaces.

 

An analogy would be that someone watches the sun throughout the day and assumes the sun goes around the earth. From an experiential point of view, that works, it’s practical, you can live and plan by it.

 

But our view changed as we became aware of other planets and bodies in the solar system. We realized “sun goes around the earth” doesn’t scale; the motions of the other bodies could not be accounted for by “sun goes around the earth.” But they could be accounted for by “all planets go around the sun,” the non-intuitive but scalable solution where everything makes sense mathematically.

 

So as long as you know all your content is in the same color space then using a simple table might appear to work fine. But just be aware that the moment you need to account for a different color space, that solution’s going to start failing, and color spaces will have to be included in the conversion. And that all Photoshop color conversions (except DeviceLink) use the “sun” of Lab as their hub.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

Which 'flavour' of RGB or more accurately which RGB colour profile is that table converting to Lab? The calculations are different for each variation in the profile. Those variations include the the primary colours, the gamma, the white point....

 

If you want accurate numbers out you need accurate numbers in - hence the maths differs for every profile or needs to be built with more inputs to take the RGB profile detailed specification entry into those calculations.

 

Dave

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

They are sRGB values that I got using a Spectro 1 Pro spectrophotometer.  All the values were collected in the same way. I'm not attempting to compare colors from different color spaces. What do you think I am,[inappropriate reference removed by moderator]

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

If you're using an i1 spectro, then the native measurements would be Lab and/or spectral data. sRGB would be derived from Lab. What software are you using with your spectro?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

Software? There's an app that works on my iPhone. I don't use the Compare or Color Match features. I use the Saved Colors function. I scan a bunch of colors, send a csv file to iCloud, and upload it into Excel. The sheet contains a lot of information I don't understand right now, but all I wanted were the hex values anyway. With the hex code, I use the hex2dec Excel function to split the code into R, G,  and B. From there, I calculate the hue, luminance, saturation, and brightness. I believe you helped me find the formulas for doing this, Stephen, so I blame everything on you. And now I have the Delta-E values. Oh! And I found some VB code that displays the color in column A (as long as R is in B, G is in C, and B is in D). I know Excel is not entirely accurate with its colors, but it shows color relationships consistently enough for what I'm doing. I created a 24 color card in Excel using the values for a Calibrite Color Checker and then created a LUT for it in 3D LUT Creator for when an extra level of precision is necessary. Having all the info in an Excel spreadsheet allows me to filter and sort and answer questions like "What's the most saturated color we have in the orange family?" Now I can answer what the closest alternative colors, or which colors can be dropped from the catalog because they're essentially duplicates.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

This is going nowhere. A spectrophotometer reads and outputs Lab values, which are then recalculated into sRGB, Adobe RGB, ProPhoto or whatever you want.

 

You've been given the answer to your question several times, but for some reason you refuse to accept it. There's nothing more we can do here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

LATEST
quote

This is going nowhere. A spectrophotometer reads and outputs Lab values...


By @D Fosse


Agreed 100%, I said similar earlier in the topic.

 

The original measurements are in Lab.

 

To calculate dE start with Lab.

 

It makes no sense to input sRGB values into Excel and look for a formula to covert RGB to Lab when Lab is the starting point.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

'I know Excel is not entirely accurate with its colors'

It is not at all accurate - it is not colour managed and therefore just sends RGB values direct to screen that should be converted from document colour space to monitor colour space by the CMS.

 

Dave

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 09, 2024 Dec 09, 2024

Copy link to clipboard

Copied

If you are measuring and matching real world colours, which from your reference to using the Spectro 1, I presume you are, then forget Hex values and RGB colours (which are the same thing). The spectro will output Lab values which is all you need. Don't bother trying to convert from Lab into a restricted colour space such as sRGB, then back again, just use Lab.

 

It may be worth though, rather than talking about conversion which is part of the process, starting a thread with a description of what you are actually trying to achieve and what tools you have to hand. There are a lot of people in this forum (some of whom are in this thread), with working experience of colour management in industry, including image capture, archiving, printing etc

 

If we knew what the start and end points were, we may be able to guide you with a better prcocess in between.

 

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

It might help to understand the quote below from the book “Real World Photoshop CS3” which was published in 2008. It also appeared in the book’s earlier editions by the late Bruce Fraser, as well as his book “Real World Color Management” published in 2003. Bruce didn’t just say that out of thin air. He worked closely with the Photoshop team.

 

Real-World-Photoshop-CS3-Lab-color-quote.png

 

The second quote, below, is from page 33 of “The Digital Print” (2014) by Jeff Schewe, who also works closely with the Photoshop, Camera Raw, and Lightroom teams.

 

The-Digital-Print-Lab-color-quote.png

 

Anyone who studies how Photoshop color works eventually understands that: 

  • Lab is its reference color space for color conversions.
  • Any color conversions must be corrected for the specific color space of the current color mode (such as sRGB vs Adobe RGB, or FOGRA CMYK vs US SWOP CMYK). 

 

If you show an Excel spreadsheet or color conversion table that doesn’t account for color space, or doesn’t use Lab as a reference color space, that conversion table is not useful or reliable when discussing Photoshop.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2024 Dec 08, 2024

Copy link to clipboard

Copied

I would take that one step further:

'If you show an Excel spreadsheet or color conversion table that doesn’t account for color space, or doesn’t use Lab as a reference color space, that conversion table is not useful or reliable' when discussing Photoshop.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines