Question on defining custom gamut in dcamprof for custom looks

In the neutral-plus file that comes with dcamprof (actually I may have copied it over from the files in Lumariver profile designer) it describes using custom gamuts. The example given (shown below) is for AdobeRGB. However, it refers to the given matrix as an RGB to XYZ matrix. It’s not an RGB to XYZ matrix, though. What’s actually shown is an XYZ to RGB matrix.

So, either the words “RGB to XYZ” are mistaken, and it was meant to read “XYZ to RGB”, or the matrix shown is incorrect. I emailed Anders Torger several months ago and he said that it had been a few years since he’s done anything with dcamprof and didn’t remember. I was going to make a custom look tonight and remembered this, so figured I’d ask here.

When I substitute the matrix for its inverse, I don’t really see a difference in the resulting profile so maybe dcamprof detects if the matrix needs to be inverted?

// Just for demonstration of the custom matrix feature we specify AdobeRGB with its RGB to XYZ matrix
// instead of using the "AdobeRGB" shortcut. The matrix which will automatically be remapped to D50
// whitepoint (AdobeRGB is D65).
//"InnerGamut": "AdobeRGB",
"InnerGamut": [
   [  2.04159, -0.56501, -0.34473 ],
   [ -0.96924,  1.87597,  0.04156 ],
   [  0.01344, -0.11836,  1.01517 ]

It’s definitely wrong in the data file. He has it right in the software, the correct matrix for XYZ->RGB is in colmath.h.

Whether he detects proper inverses would require code inspection, and I haven’t done much of that with dcamprof.

Good idea, I downloaded dcamprof as a binary from the website so didn’t think about checking github.

I think the look.c file has the relevant code. I see in the gamut remapping section that a function called gamut_remap_xyz2rgb is called. So, it appears the matrix given in the neutral-plus example is correct, and he merely incorrectly referred to it as “RGB to XYZ”.

Guess I ended up answering my own question, but thanks for mentioning the code and prompting me to check if github had it!

1 Like