2
$\begingroup$

I know there are some functions to work with XYZ color space, e.g. XYZColor, ColorConvert etc.. But I couldn't find any functions to calculate the color matching functions for CIE Standard Observers (2° and 10° ones).

Does Mathematica actually have such built-in functions, or should I continue using my own tabulations of them?

$\endgroup$
4
$\begingroup$

The data points from 385 nm to 745 nm with 5 nm step are present in Mathematica, but are not directly accessible. This answer by Simon Woods explains how to access them:

(* Mention ChromaticityPlot function, otherwise the
   "Image`ColorOperationsDump`..." tables are not loaded *)
ChromaticityPlot;

(* Construct an interpolation function from the tables of
    wavelengths and tristimulus values *)
{x, y, z} = Interpolation[
   Thread[{Image`ColorOperationsDump`$wavelengths, #}]] & /@ 
   Transpose[Image`ColorOperationsDump`tris];

Plot[{x[λ], y[λ], z[λ]}, {λ, 385, 745}, PlotStyle -> {Red, Green, Blue}]

Output of the Plot command

$\endgroup$
  • $\begingroup$ Just "touching" by evaluating ChromaticityPlot; suffices; no need to plot anything. $\endgroup$ – J. M. will be back soon Oct 13 '18 at 15:37
  • $\begingroup$ @J.M.issomewhatokay. thanks, edited. $\endgroup$ – Ruslan Oct 13 '18 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.