skimage2.color.xyz_tristimulus_values#

skimage2.color.xyz_tristimulus_values(*, illuminant, observer, dtype=<class 'float'>)[source]#

Get the CIE XYZ tristimulus values.

Given an illuminant and observer, this function returns the CIE XYZ tristimulus values [2] scaled such that \(Y = 1\).

Parameters:
illuminant{“A”, “B”, “C”, “D50”, “D55”, “D65”, “D75”, “E”}

The name of the illuminant (the function is NOT case sensitive).

observer{“2”, “10”, “R”}

One of: 2-degree observer, 10-degree observer, or ‘R’ observer as in R function grDevices::convertColor [3].

dtypedtype, optional

Output data type.

Returns:
valuesarray

Array with 3 elements \(X, Y, Z\) containing the CIE XYZ tristimulus values of the given illuminant.

Raises:
ValueError

If either the illuminant or the observer angle are not supported or unknown.

Notes

The CIE XYZ tristimulus values are calculated from \(x, y\) [1], using the formula

\[X = x / y\]
\[Y = 1\]
\[Z = (1 - x - y) / y\]

The only exception is the illuminant “D65” with aperture angle 2° for backward-compatibility reasons.

References

Examples

Get the CIE XYZ tristimulus values for a “D65” illuminant for a 10 degree field of view

>>> xyz_tristimulus_values(illuminant="D65", observer="10")
array([0.94809668, 1.        , 1.07305136])