colour.models.cie_lab Module¶
CIE Lab Colourspace¶
Defines the CIE Lab colourspace transformations:
See also
References
[1] | Wikipedia. (n.d.). Lab color space. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/Lab_color_space |
-
colour.models.cie_lab.
XYZ_to_Lab
(XYZ, illuminant=(0.3457, 0.3585))[source]¶ Converts from CIE XYZ tristimulus values to CIE Lab colourspace.
Parameters: - XYZ (array_like) – CIE XYZ tristimulus values.
- illuminant (array_like, optional) – Reference illuminant xy chromaticity coordinates or CIE xyY colourspace array.
Returns: CIE Lab colourspace array.
Return type: ndarray
Notes
- Input CIE XYZ tristimulus values are in domain [0, 1].
- Input illuminant xy chromaticity coordinates or CIE xyY colourspace array are in domain [0, \(\infty\)].
- Output Lightness \(L^*\) is in range [0, 100].
References
[2] Lindbloom, B. (2003). XYZ to Lab. Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_XYZ_to_Lab.html Examples
>>> XYZ = np.array([0.07049534, 0.10080000, 0.09558313]) >>> XYZ_to_Lab(XYZ) array([ 37.9856291..., -23.6290768..., -4.4174661...])
-
colour.models.cie_lab.
Lab_to_XYZ
(Lab, illuminant=(0.3457, 0.3585))[source]¶ Converts from CIE Lab colourspace to CIE XYZ tristimulus values.
Parameters: - Lab (array_like) – CIE Lab colourspace array.
- illuminant (array_like, optional) – Reference illuminant xy chromaticity coordinates or CIE xyY colourspace array.
Returns: CIE XYZ tristimulus values.
Return type: ndarray
Notes
- Input Lightness \(L^*\) is in domain [0, 100].
- Input illuminant xy chromaticity coordinates or CIE xyY colourspace array are in domain [0, \(\infty\)].
- Output CIE XYZ tristimulus values are in range [0, 1].
References
[3] Lindbloom, B. (2008). Lab to XYZ. Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_Lab_to_XYZ.html Examples
>>> Lab = np.array([37.98562910, -23.62907688, -4.41746615]) >>> Lab_to_XYZ(Lab) array([ 0.0704953..., 0.1008 , 0.0955831...])
-
colour.models.cie_lab.
Lab_to_LCHab
(Lab)[source]¶ Converts from CIE Lab colourspace to CIE LCHab colourspace.
Parameters: Lab (array_like) – CIE Lab colourspace array. Returns: CIE LCHab colourspace array. Return type: ndarray Notes
- Lightness \(L^*\) is in domain [0, 100].
References
[4] Lindbloom, B. (2007). Lab to LCH(ab). Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_Lab_to_LCH.html Examples
>>> Lab = np.array([37.98562910, -23.62907688, -4.41746615]) >>> Lab_to_LCHab(Lab) array([ 37.9856291..., 24.0384542..., 190.5892337...])
-
colour.models.cie_lab.
LCHab_to_Lab
(LCHab)[source]¶ Converts from CIE LCHab colourspace to CIE Lab colourspace.
Parameters: LCHab (array_like) – CIE LCHab colourspace array. Returns: CIE Lab colourspace array. Return type: ndarray Notes
- Lightness \(L^*\) is in domain [0, 100].
References
[5] Lindbloom, B. (2006). LCH(ab) to Lab. Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_LCH_to_Lab.html Examples
>>> LCHab = np.array([37.98562910, 24.03845422, 190.58923377]) >>> LCHab_to_Lab(LCHab) array([ 37.9856291..., -23.6290768..., -4.4174661...])