colour.models.XYZ_to_Iab#
- colour.models.XYZ_to_Iab(XYZ: Domain1, LMS_to_LMS_p_callable: Callable, matrix_XYZ_to_LMS: ArrayLike, matrix_LMS_p_to_Iab: ArrayLike) Range1[source]#
Convert from CIE XYZ tristimulus values to IPT-like \(Iab\) colour representation.
Perform conversion from CIE XYZ tristimulus values to IPT colourspace and other similar conversions. It implements a generic transformation from CIE XYZ tristimulus values to 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).
- Parameters:
XYZ (Domain1) – CIE XYZ tristimulus values.
LMS_to_LMS_p_callable (Callable) – Callable applying the forward non-linearity to the \(LMS\) colourspace array.
matrix_XYZ_to_LMS (ArrayLike) – Matrix converting from CIE XYZ tristimulus values to \(LMS\) colourspace.
matrix_LMS_p_to_Iab (ArrayLike) – Matrix converting from non-linear \(LMS_p\) colourspace to IPT-like \(Iab\) colour representation.
- Returns:
IPT-like \(Iab\) colour representation.
- Return type:
Notes
Domain
Scale - Reference
Scale - 1
XYZ1
1
Range
Scale - Reference
Scale - 1
Iab1
1
Examples
>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952]) >>> LMS_to_LMS_p = lambda x: x**0.43 >>> M_XYZ_to_LMS = np.array( ... [ ... [0.4002, 0.7075, -0.0807], ... [-0.2280, 1.1500, 0.0612], ... [0.0000, 0.0000, 0.9184], ... ] ... ) >>> M_LMS_p_to_Iab = np.array( ... [ ... [0.4000, 0.4000, 0.2000], ... [4.4550, -4.8510, 0.3960], ... [0.8056, 0.3572, -1.1628], ... ] ... ) >>> XYZ_to_Iab(XYZ, LMS_to_LMS_p, M_XYZ_to_LMS, M_LMS_p_to_Iab) ... array([ 0.3842619..., 0.3848730..., 0.1888683...])