colour.models.cie_luv Module

CIE Luv Colourspace

Defines the CIE Luv colourspace transformations:

References

[1]Wikipedia. (n.d.). CIELUV. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/CIELUV
colour.models.cie_luv.XYZ_to_Luv(XYZ, illuminant=(0.34567, 0.3585))[source]

Converts from CIE XYZ colourspace to CIE Luv colourspace.

Parameters:
  • XYZ (array_like, (3,)) – CIE XYZ colourspace matrix.
  • illuminant (array_like, optional) – Reference illuminant chromaticity coordinates.
Returns:

CIE Luv colourspace matrix.

Return type:

ndarray, (3,)

Notes

  • Input CIE XYZ colourspace matrix is in domain [0, 1].
  • Input illuminant chromaticity coordinates are in domain [0, 1].
  • Output \(L^*\) is in domain [0, 100].

References

[2]Lindbloom, B. (2003). XYZ to Luv. Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_XYZ_to_Luv.html

Examples

>>> XYZ = np.array([0.07049534, 0.1008, 0.09558313])
>>> XYZ_to_Luv(XYZ)  
array([ 37.9856291..., -28.7922944...,  -1.3558195...])
colour.models.cie_luv.Luv_to_XYZ(Luv, illuminant=(0.34567, 0.3585))[source]

Converts from CIE Luv colourspace to CIE XYZ colourspace.

Parameters:
  • Luv (array_like, (3,)) – CIE Luv colourspace matrix.
  • illuminant (array_like, optional) – Reference illuminant chromaticity coordinates.
Returns:

CIE XYZ colourspace matrix.

Return type:

ndarray, (3,)

Notes

  • Input \(L^*\) is in domain [0, 100].
  • Input illuminant chromaticity coordinates are in domain [0, 1].
  • Output CIE XYZ colourspace matrix is in domain [0, 1].

References

[3]Lindbloom, B. (2003). Luv to XYZ. Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_Luv_to_XYZ.html

Examples

>>> Luv = np.array([37.9856291, -28.79229446, -1.3558195])
>>> Luv_to_XYZ(Luv)  
array([ 0.0704953...,  0.1008    ,  0.0955831...])
colour.models.cie_luv.Luv_to_uv(Luv, illuminant=(0.34567, 0.3585))[source]

Returns the \(uv^p\) chromaticity coordinates from given CIE Luv colourspace matrix.

Parameters:
  • Luv (array_like, (3,)) – CIE Luv colourspace matrix.
  • illuminant (array_like, optional) – Reference illuminant chromaticity coordinates.
Returns:

\(uv^p\) chromaticity coordinates.

Return type:

tuple

Notes

  • Input \(L^*\) is in domain [0, 100].
  • Output \(uv^p\) chromaticity coordinates are in domain [0, 1].

References

[4]Wikipedia. (n.d.). The forward transformation. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/CIELUV#The_forward_transformation

Examples

>>> Luv = np.array([37.9856291, -28.79229446, -1.3558195])
>>> Luv_to_uv(Luv)  
(0.1508530..., 0.4853297...)
colour.models.cie_luv.Luv_uv_to_xy(uv)[source]

Returns the xy chromaticity coordinates from given CIE Luv colourspace \(uv^p\) chromaticity coordinates.

Parameters:uv (array_like) – CIE Luv u”v” chromaticity coordinates.
Returns:xy chromaticity coordinates.
Return type:tuple

Notes

  • Input \(uv^p\) chromaticity coordinates are in domain [0, 1].
  • Output xy is in domain [0, 1].

References

[5]Wikipedia. (n.d.). The reverse transformation. Retrieved from http://en.wikipedia.org/wiki/CIELUV#The_reverse_transformation

Examples

>>> uv = (0.15085309882985695, 0.48532970854318019)
>>> Luv_uv_to_xy(uv)  
(0.2641477..., 0.3777000...)
colour.models.cie_luv.Luv_to_LCHuv(Luv)[source]

Converts from CIE Luv colourspace to CIE LCHuv colourspace.

Parameters:Luv (array_like, (3,)) – CIE Luv colourspace matrix.
Returns:CIE LCHuv colourspace matrix.
Return type:ndarray, (3,)

Notes

  • \(L^*\) is in domain [0, 100].

References

[6]Lindbloom, B. (2003). Luv to LCH(uv). Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_Luv_to_LCH.html

Examples

>>> Luv = np.array([37.9856291, -28.79229446, -1.3558195])
>>> Luv_to_LCHuv(Luv)  
array([  37.9856291...,   28.8241993...,  182.6960474...])
colour.models.cie_luv.LCHuv_to_Luv(LCHuv)[source]

Converts from CIE LCHuv colourspace to CIE Luv colourspace.

Parameters:LCHuv (array_like, (3,)) – CIE LCHuv colourspace matrix.
Returns:CIE Luv colourspace matrix.
Return type:ndarray, (3,)

Notes

  • \(L^*\) is in domain [0, 100].

References

[7]Lindbloom, B. (2006). LCH(uv) to Luv. Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_LCH_to_Luv.html

Examples

>>> LCHuv = np.array([37.9856291, 28.82419933, 182.69604747])
>>> LCHuv_to_Luv(LCHuv)  
array([ 37.9856291..., -28.7922944...,  -1.3558195...])