Skip to main content
scotwllm
Inspiring
December 6, 2024
Question

How does Photoshop calculate Lab values?

  • December 6, 2024
  • 5 replies
  • 4558 views

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

This topic has been closed for replies.

5 replies

Conrad_C
Community Expert
Community Expert
December 8, 2024

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.

 

 

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.

 

 

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.

davescm
Community Expert
Community Expert
December 8, 2024

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

scotwllm
scotwllmAuthor
Inspiring
December 8, 2024

I found the answer. 

D Fosse
Community Expert
Community Expert
December 8, 2024

@scotwllm 

That's exactly what I'm saying. That does not specify the RGB color space, and that makes it completely worthless.

What I've posted is the correct answer. I can't take responsibility for incorrect and misleading information you may find out on the internet.

 

All Photoshop number calculations use the open document color space first, and if that doesn't apply, it goes to your working spaces.

 

All RGB numbers refer to a specific color space: sRGB, Adobe RGB, etc. That's what a color space is - a definition of the numbers relative to a reference. That reference is Lab.

 

EDITED for clarity

Participant
December 16, 2024

Your response is well-written and thoughtful, but I've made some minor edits for clarity and flow. Here's the revised version:

For me, this simple explanation has cleared up years of cognitive ambiguity regarding color spaces. Simultaneously, it has introduced several pragmatic concerns about workflow. Feeling quite enthused, I immediately began working in Lab color in Photoshop, exporting my files to "smallest" PNG for further editing and/or printing, and to JPEG (occasionally PNG) for posting online. It took a while to realize that I'd forgotten to convert to sRGB (or CMYK for printing) before saving such images. I initially thought the blank images I saw once posted online were due to a new bug on the hosting platform, since the same images looked fine in File Explorer. Then, realizing the error was mine, I attempted to determine a means to stay clearly aware of which color space was in use in any given file.

This seemingly trivial task has proven sufficiently challenging that I'm wondering whether there are any (hopefully succinct) online resources (or a pithy response to this post) that detail how seasoned experts deal with the pragmatics of such issues in their day-to-day workflow.


PS; This response was handed to an AI for editing, as I tend to utilize excessively convoluted phraseology. The AI didn't seem to do anything other than divide the text into a few paragraphs, plus prove that I was in too much of a hurry to review its edit before posting it. I'm fine with being embarassed, yet am appending this explanation to reduce the likelihood of getting snarky comments that might divert from getting a cogent response (while realizing that this post might - on its own merits - give rise to such comments).

D Fosse
Community Expert
Community Expert
December 6, 2024

Stephen Marsh
Community Expert
Community Expert
December 6, 2024

Colour management.

 

Make 2 separate RGB files, one sRGB, the other ProPhoto RGB. Type in the same set of RGB values and compare the Lab readings. Type in the same Lab values and compare the RGB readings.

D Fosse
Community Expert
Community Expert
December 6, 2024

It's the other way round. All color space numbers are calculated from Lab.

 

Lab is the reference and at the base of all color management. It is one of two commonly used Profile Connection Spaces (the other is CIE XYZ).

 

A standard profile conversion goes, say, Adobe RGB > Lab > sRGB.

 

Lab numbers define a color absolutely.

scotwllm
scotwllmAuthor
Inspiring
December 8, 2024

Hi there --

 

I appreciate the time you invested to respond to my question.  However, you answered a question I didn't ask. I asked how does Photoshop calculate the numbers that appear in the color picker when a user enters RGB values. I've found formulas online that purport to do it, but they're written in code or use calculus. I took calculus around 40 years ago and have never needed to use it until now. I need to calculate the Delta-E between multiple colors, and plugging them into a website form one by one takes too much time. I'm too old to waste it on that kind of stuff, know what I mean?

D Fosse
Community Expert
Community Expert
December 8, 2024

We did answer it. The answer is color management. The Lab numbers are always there as the definition of the RGB numbers in the given RGB color space.

 

The online calculators are rubbish because they usually don't even consider color management, color spaces and icc profiles. RGB what? There is no such thing as "RGB". Numbers are undefined until associated with a specific color space.

 

Look at the screenshot I posted below. That's how given Lab numbers are represented in different color spaces.