colour.models.Iab_to_XYZ#

colour.models.Iab_to_XYZ(Iab: ArrayLike, LMS_p_to_LMS_callable: Callable, matrix_Iab_to_LMS_p: ArrayLike, matrix_LMS_to_XYZ: ArrayLike) NDArrayFloat[source]#

Convert from IPT-like $$Iab$$ colour representation to CIE XYZ tristimulus values.

This definition is used to perform conversion from IPT colourspace to CIE XYZ tristimulus values and for other similar conversions. It implements a generic transformation from Lightness $$I$$, $$a$$ and $$b$$ representing red-green dimension, i.e. the dimension lost by protanopes and the yellow-blue dimension, i.e. the dimension lost by tritanopes, respectively to CIE XYZ tristimulus values.

Parameters:
• Iab (ArrayLike) – IPT-like $$Iab$$ colour representation.

• LMS_p_to_LMS_callable (Callable) – Callable applying the reverse non-linearity to the $$LMS_p$$ colourspace array.

• matrix_Iab_to_LMS_p (ArrayLike) – Matrix converting from IPT-like $$Iab$$ colour representation to non-linear $$LMS_p$$ colourspace.

• matrix_LMS_to_XYZ (ArrayLike) – Matrix converting from $$LMS$$ colourspace to CIE XYZ tristimulus values.

Returns:

CIE XYZ tristimulus values.

Return type:

numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

Iab

I : [0, 1]

a : [-1, 1]

b : [-1, 1]

I : [0, 1]

a : [-1, 1]

b : [-1, 1]

Range

Scale - Reference

Scale - 1

XYZ

[0, 1]

[0, 1]

Examples

>>> Iab = np.array([0.38426191, 0.38487306, 0.18886838])
>>> LMS_p_to_LMS = lambda x: x ** (1 / 0.43)
>>> M_Iab_to_LMS_p = np.linalg.inv(
...     np.array(
...         [
...             [0.4000, 0.4000, 0.2000],
...             [4.4550, -4.8510, 0.3960],
...             [0.8056, 0.3572, -1.1628],
...         ]
...     )
... )
>>> M_LMS_to_XYZ = np.linalg.inv(
...     np.array(
...         [
...             [0.4002, 0.7075, -0.0807],
...             [-0.2280, 1.1500, 0.0612],
...             [0.0000, 0.0000, 0.9184],
...         ]
...     )
... )
>>> Iab_to_XYZ(Iab, LMS_p_to_LMS, M_Iab_to_LMS_p, M_LMS_to_XYZ)
...
array([ 0.2065400...,  0.1219722...,  0.0513695...])