colour.adaptation.chromatic_adaptation_VonKries

colour.adaptation.chromatic_adaptation_VonKries(XYZ, XYZ_w, XYZ_wr, transform='CAT02')[source]

Adapts given stimulus from test viewing conditions to reference viewing conditions.

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values of stimulus to adapt.
  • XYZ_w (array_like) – Test viewing condition CIE XYZ tristimulus values of whitepoint.
  • XYZ_wr (array_like) – Reference viewing condition CIE XYZ tristimulus values of whitepoint.
  • transform (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02_BRILL_CAT’, ‘Bianco’, ‘Bianco PC’}, Chromatic adaptation transform.
Returns:

CIE XYZ_c tristimulus values of the stimulus corresponding colour.

Return type:

ndarray

Notes

Domain Scale - Reference Scale - 1
XYZ [0, 1] [0, 1]
XYZ_n [0, 1] [0, 1]
XYZ_r [0, 1] [0, 1]
Range Scale - Reference Scale - 1
XYZ_c [0, 1] [0, 1]

References

[Fairchild2013t]

Examples

>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> XYZ_w = np.array([0.95045593, 1.00000000, 1.08905775])
>>> XYZ_wr = np.array([0.96429568, 1.00000000, 0.82510460])
>>> chromatic_adaptation_VonKries(XYZ, XYZ_w, XYZ_wr)  # doctest: +ELLIPSIS
array([ 0.2163881...,  0.1257    ,  0.0384749...])

Using Bradford method:

>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> XYZ_w = np.array([0.95045593, 1.00000000, 1.08905775])
>>> XYZ_wr = np.array([0.96429568, 1.00000000, 0.82510460])
>>> transform = 'Bradford'
>>> chromatic_adaptation_VonKries(XYZ, XYZ_w, XYZ_wr, transform)
... # doctest: +ELLIPSIS
array([ 0.2166600...,  0.1260477...,  0.0385506...])