Copy link to clipboard
Copied
Hello,
I have sRGB input image.
It seems that Adobe Photoshop's LAB Color Space conversion is different from anything I saw on other sources.
Anyone knows why is it different?
What Photoshop do differently?
Thank You.
Copy link to clipboard
Copied
It can't be.
Lab is a standard and standardized color space, used for instance as one of two Profile Connection Spaces in color management operations (the other is CIE XYZ). If it wasn't consistent, the whole thing would fall apart.
Lab is supposed to be a reference.
Rounding errors can happen, particularly in 8 bit operations. Or, what you thought was sRGB is in fact untagged, or the values read in a non-color managed environment.
I think you need to give examples.
Copy link to clipboard
Copied
D Fosse, I totally agree with you write.
Yet still, When I use the formulas as in:
Welcome to Bruce Lindbloom's Web Site
Or
http://www.easyrgb.com/?X=MATH
I get different results than Photoshop.
I also used MATLAB's built in functions and they also differ from Photoshop.
If you can shed light what Photoshop does, I'd be more than happy to learn.
Thank You.
Copy link to clipboard
Copied
You still did not mention which Color Space your image is in.
Copy link to clipboard
Copied
Hi,
I did, it was sRGB.
Let me describe my process.
Since the input is sRGB and Photoshop's LAB is D50 we first need to convert from sRGB to XYZ at D50.
This can be done using the Matrix in this page (The very last matrix sRGB -> XYZ D50):
M = [0.4360747 0.3850649 0.1430804
0.2225045 0.7168786 0.0606169
0.0139322 0.0971045 0.7141733]
Now we have XYZ with D50 White Point all needed is to convert to XYZ using this:
Welcome to Bruce Lindbloom's Web Site
If you can shed light what Photoshop does, I'd be more than happy to learn.
Thank You.
Copy link to clipboard
Copied
I did, it was sRGB.
Sorry, you did in your original post to boot.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Royi+A wrote
Since the input is sRGB and Photoshop's LAB is D50 we first need to convert from sRGB to XYZ at D50.
That's not necessary. The white point is remapped directly in the conversion sRGB > Lab. There's no need to go via XYZ at all.
Standard working color spaces only support relative colorimetric rendering intent, which specifies white point remapping. It would be different with absolute colorimetric (but that's moot).
The easyrgb site can be disregarded as it just operates with generic "RGB", whatever that is...I see no reason to take that seriously.
Copy link to clipboard
Copied
D Fosse,
Would you share how to do this?
All references I found (Used mainly Bruce Lindbloom site) goes from sRGB -> XYZ -> LAB.
I'd be more than happy to any guidance how to replicate Photoshop's results.
Thank You.
Copy link to clipboard
Copied
I'm just a humble working photographer, not a computer scientist... I can't give you the math (come back, Chris Cox...)
But what I do know is that a conversion from sRGB to Lab is 100% unambiguous. Lab is a profile connection space, it is the definition of the values. The D65 to D50 white point remapping is defined in those conversion tables. It's integral to the whole process.
Lab and XYZ are equivalent in color management. One isn't more "authoritative" than the other. Lab is derived from XYZ, but the former is perceptually uniform where the latter isn't.
I suspect you're overcomplicating this.
Copy link to clipboard
Copied
D Fosse, I'm not over complicating this.
There is a math to do so and I follow it.
Of course all is known standard.
Within the standard there are a lot parameters (Degrees of Freedom) to be chosen.
I wonder what are the parameters chosen by Photoshop.
There is Linear Mapping form RGB -> XYZ, There a White Point compensation and the then Non Linear Mapping form XYZ to LAB.
What you write is true in general and I know it.
What I need is what steps are taken in Photoshop.
What I do is sRGB -> XYZ (D65) -> XYZ (D50) -> LAB.
I wonder if that what Photoshop does or something else.
Thank You.
Copy link to clipboard
Copied
If you really want to dig into the math, I would start looking at the ICC's site. Maybe they have links to white papers on the subject.
The D50 white point for Lab is specified by the icc. And Photoshop follows icc specs. Of course it's possible to have other white points, but then you'd be talking customized, non-standard spaces and profiles.
Copy link to clipboard
Copied
D Fosse,
All math is in Bruce Lindbloom site.
Again, the exact matrices going from RGB (D65) -> XYZ (D50) -> LAB are written.
I also used Bradford adaptation since this what Photoshop is using.
My code also is perfectly aligned with his calculator (Which is reference in the Internet).
What I need is someone to confirm what's going on in Photoshop.
Copy link to clipboard
Copied
Photoshop does not use a formula for converting to and from sRGB. It does not even contain colour conversion code. It uses a CMM, which is software that uses the contents of two RGB profiles to make the conversion. The results might happen to match a formula but almost all modern software will transform colours using a CMM. If you find sites proposing a mathematical formula, this is only one way to make a conversion, and compared to what is actually done it is an oversimplifaction. (Most sites giving formulas are also hopelessly wrong and ignorant of colour science; yours seems to be unusual in that it does understand colour science).
So, what does a CMM do?
1. Each ICC profile tells how to convert between a single colour space and PCS (profile connection space).
2. The profile contains up to three different mappings depending on rendering intent.
3. PCS is either XYZ or Lab, which do have a simple mathematical transform between them.
4. The profile may contain a matrix, or it may contain a LUT (lookup table). A CMM must use whichever one it finds.
5. Lab is a profile, but it is possible software might optimize out a known Lab to Lab conversion.
Adobe's CMM also does black point compensation, which is outside the original scope of profile-to-profile conversion.
What can you do? You can use suitable software (or your own software) to analyse the Lab and sRGB profiles used by Photoshop. You can see whether they use a matrix or LUT or other method. You can examine whether rendering intent is used. You can consider the effect of black point compensation.
Copy link to clipboard
Copied
Yes, except that standard working color spaces are always matrix (they can be mathematically described using ideal parameters), and only support one rendering intent (relcol). So the conversion is unambiguous and can only yield one result. There is no leeway or room for interpretation.
Black point compensation comes into play for device profiles (monitor or print).
And yes, Photoshop uses a CMM, the Adobe CMM. But the icc specifies the rules for how that CMM operates.
Copy link to clipboard
Copied
This will be the many reason but I am told you original point, the original point is Photoshop have the RGB or Hex values be entirely different, RGB/HEX VALUES is the main different here.
Copy link to clipboard
Copied
tmyusuf74, Sorry I didn't get you.
What do you mean RGB HEX Values are the main different here?
Thank You.
Copy link to clipboard
Copied
Just disregard that, Royi. Hexadecimal notation is just missing the point and obviously irrelevant.
I'm getting the impression you want to dissect this down to the mathematical basis. I can't help you there, but as Chris Cox stated in that other (old) thread you posted to, Photoshop follows the specifications from the icc strictly. As it has to of course, since the whole business of color management rests on icc specs.
In any case, that's where I'd start.
Copy link to clipboard
Copied
Is sRGB not a device profile? I don't recall a technical difference. Why would you bypass BPC for it?
Copy link to clipboard
Copied
Just reviewed Easyrgb.com. It has some colour science but only partially. It is worthless and damaging in its view of CMYK conversion, and its RGB-XYZ is worthless because it does not define which RGB is its reference. Any site which gives "RGB to anything" is worthless and damaging if it does not define which RGB, except for certain derived spaces like HSB.
Copy link to clipboard
Copied
I mostly followed Bruce Lindbloom site:
Copy link to clipboard
Copied
Is sRGB not a device profile? I don't recall a technical difference. Why would you bypass BPC for it?
It is a device class profile, in the sense that it was specified as an idealized description of a CRT monitor. But it's not a device profile in the sense that it describes a particular, specific device.
Actually I'm not sure how the flat "toe" in the sRGB tone response curve is handled in a conversion. I need to read up on that. Obviously it's there because the CRTs (like any other present monitor) weren't able to reproduce full black.
In other cases, like Adobe RGB to Lab, or Adobe RGB to ProPhoto, black is just mapped to black and no BPC is necessary
Copy link to clipboard
Copied
I read an interesting article here sRGB profiles on ICC's web site. It talks about different profiles (V2,V4); indicates the V4 will be better (hence, different); makes it plain that they do contain different mappings for different rendering intents; and talks about variations from still other profiles related to D50/D65 mapping. This should make it unambiguous that there is no single, correct XYZ <-> sRGB mapping; it will depend on the profile and rendering, if not black point (which it says is set to zero in the V4 profile).
So the first site mentioned, no matter how good its formula, is only describing one of the many possible and valid mappings between these two colour spaces.
Copy link to clipboard
Copied
The version 4 specification for sRGB has been out for a while, and it does look promising on the face of it. Support for perceptual rendering intent should be interesting.
The problem is that no one so far uses it or supports it. The icc itself says that v4 may not always work well with v2, and recommends a full version 4 path. But there is no version 4 Adobe RGB or ProPhoto yet.
The only ones who have started to implement v4 profiles are the makers of calibration software. Version 4 is increasingly becoming the default option for monitor profiles - and people get into trouble over it, and have to change back to v2.
In any case, a revision of the sRGB spec is overdue. It's still widely used as a generic monitor profile, but no longer as appropriate for that purpose as it once was. The primaries aren't quite the same in LCD vs CRT, tone response curves aren't identical, and the flat "toe" can go away and be replaced with standard black point compensation.
Still, sRGB is underrated and the bad reputation is wholly undeserved. It was at the time a monumental achievement, and it is the foundation that modern color management was built on. Even today, sRGB is what allows people to work without color management and still see a roughly right representation on screen. It does what it is supposed to do remarkably well, even today.