colour.adaptation.matrix_chromatic_adaptation_VonKries

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

Computes the chromatic adaptation matrix from test viewing conditions to reference viewing conditions.

Parameters
  • 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 2008’, ‘Bianco 2010’, ‘Bianco PC 2010’}, Chromatic adaptation transform.

Returns

Chromatic adaptation matrix \(M_{cat}\).

Return type

ndarray

Raises

KeyError – If chromatic adaptation method is not defined.

Notes

Domain

Scale - Reference

Scale - 1

XYZ_w

[0, 1]

[0, 1]

XYZ_wr

[0, 1]

[0, 1]

References

[Fai13b]

Examples

>>> XYZ_w = np.array([0.95045593, 1.00000000, 1.08905775])
>>> XYZ_wr = np.array([0.96429568, 1.00000000, 0.82510460])
>>> matrix_chromatic_adaptation_VonKries(XYZ_w, XYZ_wr)
... 
array([[ 1.0425738...,  0.0308910..., -0.0528125...],
       [ 0.0221934...,  1.0018566..., -0.0210737...],
       [-0.0011648..., -0.0034205...,  0.7617890...]])

Using Bradford method:

>>> XYZ_w = np.array([0.95045593, 1.00000000, 1.08905775])
>>> XYZ_wr = np.array([0.96429568, 1.00000000, 0.82510460])
>>> method = 'Bradford'
>>> matrix_chromatic_adaptation_VonKries(XYZ_w, XYZ_wr, method)
... 
array([[ 1.0479297...,  0.0229468..., -0.0501922...],
       [ 0.0296278...,  0.9904344..., -0.0170738...],
       [-0.0092430...,  0.0150551...,  0.7518742...]])