colour.models.Iab_to_XYZ#

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

Convert from IPT-like \(Iab\) colour representation to CIE XYZ tristimulus values.

Perform conversion from IPT colourspace to CIE XYZ tristimulus values and other similar conversions. It implements a generic transformation from lightness \(I\), \(a\) representing the red-green dimension (the dimension lost by protanopes), and \(b\) representing the yellow-blue dimension (the dimension lost by tritanopes) to CIE XYZ tristimulus values.

Parameters:
  • Iab (Domain1) – 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

1

1

Range

Scale - Reference

Scale - 1

XYZ

1

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...])