colour.models.hunter_lab Module

Hunter L,a,b Colour Scale

Defines the Hunter L,a,b colour scale transformations:

References

[1]HunterLab. (2008). Hunter L,a,b Color Scale. Retrieved from http://www.hunterlab.se/wp-content/uploads/2012/11/Hunter-L-a-b.pdf
colour.models.hunter_lab.XYZ_to_K_ab_HunterLab1966(XYZ)[source]

Converts from whitepoint CIE XYZ tristimulus values to Hunter L,a,b \(K_{a}\) and \(K_{b}\) chromaticity coefficients.

Parameters:XYZ (array_like) – Whitepoint CIE XYZ tristimulus values.
Returns:Hunter L,a,b \(K_{a}\) and \(K_{b}\) chromaticity coefficients.
Return type:ndarray

Notes

  • Input CIE XYZ tristimulus values are in domain [0, 100].

References

[2]HunterLab. (2008). Illuminant Factors in Universal Software and EasyMatch Coatings. Retrieved from https://support.hunterlab.com/hc/en-us/article_attachments/201437785/an02_02.pdf

Examples

>>> XYZ = np.array([109.850, 100.000, 35.585])
>>> XYZ_to_K_ab_HunterLab1966(XYZ)  
array([ 185.2378721...,   38.4219142...])
colour.models.hunter_lab.XYZ_to_Hunter_Lab(XYZ, XYZ_n=array([ 96.38, 100., 82.45]), K_ab=array([ 173.51, 58.48]))[source]

Converts from CIE XYZ tristimulus values to Hunter L,a,b colour scale.

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values.
  • XYZ_n (array_like, optional) – Reference illuminant tristimulus values.
  • K_ab (array_like, optional) – Reference illuminant chromaticity coefficients, if K_ab is set to None it will be computed using XYZ_to_K_ab_HunterLab1966().
Returns:

Hunter L,a,b colour scale array.

Return type:

ndarray

Notes

  • Input CIE XYZ and reference illuminant tristimulus values are in domain [0, 100].
  • Output Lightness \(L^*\) is in range [0, 100].

Examples

>>> XYZ = np.array([0.07049534, 0.10080000, 0.09558313]) * 100
>>> D50 = HUNTERLAB_ILLUMINANTS[
...     'CIE 1931 2 Degree Standard Observer']['D50']
>>> XYZ_to_Hunter_Lab(XYZ, D50.XYZ_n, D50.K_ab)   
array([ 31.7490157..., -15.1146262...,  -2.7866075...])
colour.models.hunter_lab.Hunter_Lab_to_XYZ(Lab, XYZ_n=array([ 96.38, 100., 82.45]), K_ab=array([ 173.51, 58.48]))[source]

Converts from Hunter L,a,b colour scale to CIE XYZ tristimulus values.

Parameters:
  • Lab (array_like) – Hunter L,a,b colour scale array.
  • XYZ_n (array_like, optional) – Reference illuminant tristimulus values.
  • K_ab (array_like, optional) – Reference illuminant chromaticity coefficients, if K_ab is set to None it will be computed using XYZ_to_K_ab_HunterLab1966().
Returns:

CIE XYZ tristimulus values.

Return type:

ndarray

Notes

  • Input Lightness \(L^*\) is in domain [0, 100].
  • Input CIE XYZ and reference illuminant tristimulus values are in domain [0, 100].
  • Output CIE XYZ tristimulus values are in range [0, 100].

Examples

>>> Lab = np.array([31.74901573, -15.11462629, -2.78660758])
>>> D50 = HUNTERLAB_ILLUMINANTS[
...     'CIE 1931 2 Degree Standard Observer']['D50']
>>> Hunter_Lab_to_XYZ(Lab, D50.XYZ_n, D50.K_ab)   
array([  7.049534,  10.08    ,   9.558313])