Defines various chromatic adaptation transforms (CAT) and objects to calculate the chromatic adaptation matrix between two given CIE XYZ colourspace matrices:
References
[1] | (1, 2, 3, 4, 5, 6) http://brucelindbloom.com/Eqn_ChromAdapt.html |
[2] | (1, 2) http://rit-mcsl.org/fairchild//files/FairchildYSh.zip |
[3] | (1, 2, 3) http://en.wikipedia.org/wiki/CIECAM02#CAT02 |
XYZ Scaling chromatic adaptation transform. [1]
XYZ_SCALING_CAT : array_like, (3, 3)
Bradford chromatic adaptation transform. [1]
BRADFORD_CAT : array_like, (3, 3)
Von Kries chromatic adaptation transform. [1]
VON_KRIES_CAT : array_like, (3, 3)
Fairchild chromatic adaptation transform. [2]
FAIRCHILD_CAT : array_like, (3, 3)
CAT02 chromatic adaptation transform. [3]
CAT02_CAT : array_like, (3, 3)
Inverse CAT02 chromatic adaptation transform. [3]
CAT02_INVERSE_CAT : array_like, (3, 3)
Supported chromatic adaptation transform methods.
Returns the chromatic adaptation matrix from given source and target CIE XYZ colourspace array_like variables.
Parameters: |
|
---|---|
Returns: | Chromatic adaptation matrix. |
Return type: | ndarray, (3, 3) |
Raises: | KeyError – If chromatic adaptation method is not defined. |
References
[4] | http://brucelindbloom.com/Eqn_ChromAdapt.html (Last accessed 24 February 2014) |
Examples
>>> XYZ1 = np.array([1.09923822, 1.000, 0.35445412])
>>> XYZ2 = np.array([0.96907232, 1.000, 1.121792157])
>>> chromatic_adaptation_matrix(XYZ1, XYZ2)
array([[ 0.8714561..., -0.1320467..., 0.4039483...],
[-0.0963880..., 1.0490978..., 0.160403... ],
[ 0.0080207..., 0.0282636..., 3.0602319...]])
Using Bradford method:
>>> XYZ1 = np.array([1.09923822, 1.000, 0.35445412])
>>> XYZ2 = np.array([0.96907232, 1.000, 1.121792157])
>>> method = 'Bradford'
>>> chromatic_adaptation_matrix(XYZ1, XYZ2, method)
array([[ 0.8518131..., -0.1134786..., 0.4124804...],
[-0.1277659..., 1.0928930..., 0.1341559...],
[ 0.0845323..., -0.1434969..., 3.3075309...]])