CHROMiX

[Q] Convert XYZ to RGB

My source data is the Munsell real.dat file found at:

http://www.cis.rit.edu/mcsl/online/munsell.php

and I need to convert this data into the sRGB color space.

I am pretty sure I know how to accomplish this, but was hoping for
some confirmation that my method is accurate.

The method I am using is based on the sample code found at:

http://casoilresource.lawr.ucdavis.edu/drupal/node/201

The primary question I have is how to correctly apply a chromatic
adaptation transform to the XYZ color to convert it from its own
reference white to the reference white of the RGB system - assuming I
need to. The Munsell data was apparently calculated using illuminant
C. What is the reference white of the sRGB system? Is it D65? If so, I
believe I would want to apply the following matrix:

0.990490 -0.012269 -0.003515
-0.007115 1.015427 0.006679
-0.011434 -0.002878 0.919313

This is the Bradford matrix found at http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html

The sample code I pointed to above does not appear to apply this
matrix and I believe that would be considered a bug which I would want
to fix in my own code.

The Munsell data also mentions that it was calculated using the ‘CIE
1931 2 degree observer’. So, my other question is how I would take
this into account in my conversion - assuming I need to…? The
general procedure for converting between XYZ to RGB found at
http://www.brucelindbloom.com/index.html?ColorCalcHelp.html doesn’t
mention observers, but I wanted to make sure that it would not affect
the calculations and perhaps to understand what this means a little
better.

Any thoughts would be appreciated.

Thank you.

p.s. The munsell data actually starts in xyY, but the conversion from
xyY to XYZ appears to be straightforward using the formula found at
http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html.
Furthermore, the munsell data appears to be in the range of 0.0 -
100.0 which is why I believe the sample code above is doing the
division by 100.

I’ve been implementing a color conversion library in Python and have been dealing with the same thing lately. Your interpretation seems to be pretty much what I drew from it as well.

I will point out that that Munsell to RGB conversion code example did include a Bradford C to D65 adaptation matrix. That may have been added since your post was made, but it’s right here:

M_adapt_C_to_D65 <- matrix(c(0.990490, -0.012269, -0.003515, -0.007115, 1.015427, 0.006679, -0.011434, -0.002878, 0.919313), ncol=3, byrow=TRUE)

Regarding the observer functions, I think you don’t need to worry about those usually outside of spectral to XYZ conversions, which is a whole different headache. You should be good to go with just applying the illuminant adaptation matrix.

I know this is a bit of an old thread, but it’s a good question and there aren’t many good, simple explanations of the process.[/code]