Re: Erroneous color transformations with Apple CMM
Re: Erroneous color transformations with Apple CMM
- Subject: Re: Erroneous color transformations with Apple CMM
- From: Klaus Karcher <email@hidden>
- Date: Sat, 30 Jan 2010 17:03:39 +0100
Hello Lars,
thank you for asking the right questions. They pointed me in the right
direction to solve the puzzle!
The answer in a nutshell:
The ColorSync API / CMM seems to be ok, but Apple's CLUT based
ColorSpace Conversion Profiles cause huge interpolation errors.
These Profiles are required to construct the "color worlds" one needs to
call the ColorSync API functions.
... and here is the whole story:
Lars Borg wrote:
Klaus,
Which color value gives you the worst error?
There were two examples with high errors in my last mail (I'll attach
the profile "test5.icc"):
The first one caused large errors in Lab->RGB transformations with
CMMatchFloatBitmap as well as with CWMatchColors:
input:
Lab 4.39 -6.87 4.88
roundtrip result:
Lab 2.79 -3.20 1.44
DE 5.28
The second example caused high errors in XYZ->RGB transformations with
CMMatchFloatBitmap:
input:
Lab 16.61 -19.42 18.06
roundtrip result:
RGB 0.06777 0.10036 0.02969
Lab 3.93 -3.69 4.63
DE 24.26
Is Apple CMM the only CMM that gives you transform errors for this color?
Hmmm ... It's hard to tell.
Photoshop for one won't let me use the same ColorSpace Conversion
Profiles to convert XYZ<->RGB or Lab<->RGB.
The ColorSync API functions "CMMatchFloatBitmap" or "CWMatchColors" use
"color worlds" created from the RGB profile and a XYZ or Lab ColorSpace
Conversion Profile.
I guess Apple uses the "Generic Lab Profile.icc" and "Generic XYZ
Profile.icc" installed in "/System/Library/ColorSync/Profiles" for this
purpose.
When I convert colors with Photoshop from Lab to RGB and vice versa I
get reasonable results with ACE as well as with AppleCMM, but I guess
Photoshop does not use (the same) ColorSpace Conversion Profiles in this
case.
Does Photoshop use (the same? similar? or any at all?) ColorSpace
Conversion Profile to represent the "PCS color spaces" LAB and XYZ
internally?
When I use Applescript (e.g. ColorSyncScripting's "match" function) to
convert images from Lab to RGB, I can (have to!) use the Generic Lab
profile as source space and I get the same erroneous results as in my tests.
When I try to convert images from RGB to Lab or XYZ with
ColorSyncScripting, there are no error messages but the resulting images
are corrupted (zero bytes) -- but let's close this can of worms as soon
as possible ;-)
When I use ArgyllCMS with single device profiles, the results are perfect:
xicclu -ir -fb -pl test5.icc
4.390000 -6.870000 4.880000 [Lab] -> MatrixBwd ->
0.035468 0.111839 0.037560 [RGB]
xicclu -ir -ff -pl test5.icc
0.035468 0.111839 0.037560 [RGB] -> MatrixFwd ->
4.389977 -6.869981 4.879986 [Lab]
... but when I build device links with one of Apple's ColorSpace
Conversion Profiles, the results are also inaccurate with Argyll (not as
inaccurate as with the ColorSync API, but still much too imprecise for
my liking):
icclu Lab_test5_link.icc
4.390000 -6.870000 4.880000 [Lab] -> Lut ->
0.051791 0.111814 0.059181 [RGB]
xicclu -ir -ff -pl test5.icc
0.051791 0.111814 0.059181 [RGB] -> MatrixFwd ->
4.688273 -6.053104 3.920429 [Lab]
(DE= 1.30 instead of 5.28)
... and with the XYZ profile / example:
collink -qh -ir -or /System/Library/ColorSync/Profiles/Generic\ XYZ\
Profile.icc test5.icc XYZ_test5_link.icc
collink: Warning - Colorant Tag Lab value was clipped
icclu XYZ_test5_link.icc
0.013713 0.022217 0.005603 [XYZ] -> Lut ->
0.116022 0.154001 0.079159 [RGB]
xicclu -ir -ff -pl test5.icc
0.116022 0.154001 0.079159 [RGB] -> MatrixFwd ->
10.608515 -6.698491 9.561580 [Lab]
(DE=16.43 instead of 24.26)
... so apparently the (CLUT based) ColorSpace Conversion Profiles cause
the errors and not the ColorSync API functions!
Is this color outside the PCS gamut formally supported by ICC (positive
XYZs, Lab in range 0..100 and +-128, may depend on ICC version)? If so,
your mileage may differ. Some CMMs clip, some don't.
The primaries of test5 are inside the PCS/UInt16 range. As the source
colors are random RGB values transformed to Lab using the same profile,
also all test colors should fit into the PCS as well as the RGB space.
Good luck,
Thank you :-)
Klaus
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Colorsync-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden