colour.models.cie_xyy Module

CIE xyY Colourspace

Defines the CIE xyY colourspace transformations:

References

[1]http://en.wikipedia.org/wiki/CIE_1931_color_space (Last accessed 24 February 2014)
colour.models.cie_xyy.XYZ_to_xyY(XYZ, illuminant=(0.34567, 0.3585))[source]

Converts from CIE XYZ colourspace to CIE xyY colourspace and reference illuminant.

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

CIE xyY colourspace matrix.

Return type:

ndarray, (3,)

Notes

  • Input CIE XYZ colourspace matrix is in domain [0, 1].
  • Output CIE xyY colourspace matrix is in domain [0, 1].

References

[2]http://www.brucelindbloom.com/Eqn_XYZ_to_xyY.html (Last accessed 24 February 2014)

Examples

>>> XYZ_to_xyY(np.array([0.1180583421, 0.1034, 0.0515089229]))
array([ 0.4325,  0.3788,  0.1034])
colour.models.cie_xyy.xyY_to_XYZ(xyY)[source]

Converts from CIE xyY colourspace to CIE XYZ colourspace.

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

Notes

  • Input CIE xyY colourspace matrix is in domain [0, 1].
  • Output CIE XYZ colourspace matrix is in domain [0, 1].

References

[3]http://www.brucelindbloom.com/Eqn_xyY_to_XYZ.html (Last accessed 24 February 2014)

Examples

>>> xyY_to_XYZ(np.array([0.4325, 0.3788, 0.1034]))  
array([ 0.1180583...,  0.1034    ,  0.0515089...])
colour.models.cie_xyy.xy_to_XYZ(xy)[source]

Returns the CIE XYZ colourspace matrix from given xy chromaticity coordinates.

Parameters:xy (array_like) – xy chromaticity coordinates.
Returns:CIE XYZ colourspace matrix.
Return type:ndarray, (3,)

Notes

  • Input xy chromaticity coordinates are in domain [0, 1].
  • Output CIE XYZ colourspace matrix is in domain [0, 1].

Examples

>>> xy_to_XYZ((0.25, 0.25))
array([ 1.,  1.,  2.])
colour.models.cie_xyy.XYZ_to_xy(XYZ, illuminant=(0.34567, 0.3585))[source]

Returns the xy chromaticity coordinates from given CIE XYZ colourspace matrix.

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

xy chromaticity coordinates.

Return type:

tuple

Notes

  • Input CIE XYZ colourspace matrix is in domain [0, 1].
  • Output xy chromaticity coordinates are in domain [0, 1].

Examples

>>> XYZ_to_xy(np.array([0.97137399, 1, 1.04462134]))  
(0.3220741..., 0.3315655...)
>>> XYZ_to_xy((0.97137399, 1, 1.04462134))  
(0.3220741..., 0.3315655...)