colour.models.cie_xyy Module

CIE xyY Colourspace

Defines the CIE xyY colourspace transformations:

References

[1]Wikipedia. (n.d.). CIE 1931 color space. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/CIE_1931_color_space
colour.models.cie_xyy.XYZ_to_xyY(XYZ, illuminant=(0.34567, 0.3585))[source]

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

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values.
  • illuminant (array_like, optional) – Reference illuminant chromaticity coordinates.
Returns:

CIE xyY colourspace array.

Return type:

ndarray

Notes

  • Input CIE XYZ tristimulus values are in domain [0, 1].
  • Output CIE xyY colourspace array is in domain [0, 1].

References

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

Examples

>>> XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
>>> XYZ_to_xyY(XYZ)  
array([ 0.2641477...,  0.3777000...,  0.1008    ])
colour.models.cie_xyy.xyY_to_XYZ(xyY)[source]

Converts from CIE xyY colourspace to CIE XYZ tristimulus values.

Parameters:xyY (array_like) – CIE xyY colourspace array.
Returns:CIE XYZ tristimulus values.
Return type:ndarray

Notes

  • Input CIE xyY colourspace array is in domain [0, 1].
  • Output CIE XYZ tristimulus values are in domain [0, 1].

References

[3]Lindbloom, B. (2009). xyY to XYZ. Retrieved February 24, 2014, from http://www.brucelindbloom.com/Eqn_xyY_to_XYZ.html

Examples

>>> xyY = np.array([0.26414772, 0.37770001, 0.10080000])
>>> xyY_to_XYZ(xyY)  
array([ 0.0704953...,  0.1008    ,  0.0955831...])
colour.models.cie_xyy.xy_to_xyY(xy, Y=1)[source]

Converts from xy chromaticity coordinates to CIE xyY colourspace by extending the array last dimension with \(Y\) Luminance.

xy argument with last dimension being equal to 3 will be assumed to be a CIE xyY colourspace array argument and will be returned directly by the definition.

Parameters:
  • xy (array_like) – xy chromaticity coordinates or CIE xyY colourspace array.
  • Y (numeric, optional) – Optional \(Y\) Luminance value used to construct the CIE xyY colourspace array, otherwise the \(Y\) Luminance will be set to 1.
Returns:

CIE xyY colourspace array.

Return type:

ndarray

See also

xyY_to_xy()

Notes

  • This definition is a convenient object provided to implement support of illuminant argument luminance value in various colour.models package objects such as colour.models.Lab_to_XYZ() or colour.models.Luv_to_XYZ().
  • Input xy chromaticity coordinates are in domain [0, 1].
  • Output CIE xyY colourspace array is in domain [0, 1].

Examples

>>> xy = np.array([0.26414772, 0.37770001])
>>> xy_to_xyY(xy)  
array([ 0.2641477...,  0.3777000...,  1.        ])
>>> xy = np.array([0.26414772, 0.37770001, 0.10080000])
>>> xy_to_xyY(xy)  
array([ 0.2641477...,  0.3777000...,  0.1008...])
>>> xy = np.array([0.26414772, 0.37770001])
>>> xy_to_xyY(xy, 100)  
array([   0.2641477...,    0.3777000...,  100.        ])
colour.models.cie_xyy.xyY_to_xy(xyY)[source]

Converts from CIE xyY colourspace to xy chromaticity coordinates.

xyY argument with last dimension being equal to 2 will be assumed to be a xy chromaticity coordinates argument and will be returned directly by the definition.

Parameters:xyY (array_like) – CIE xyY colourspace array or xy chromaticity coordinates.
Returns:xy chromaticity coordinates.
Return type:ndarray

See also

xy_to_xyY()

Notes

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

Examples

>>> xyY = np.array([0.26414772, 0.37770001, 0.10080000])
>>> xyY_to_xy(xyY)  
array([ 0.2641477...,  0.3777000...])
>>> xy = np.array([0.26414772, 0.37770001])
>>> xyY_to_xy(xy)  
array([ 0.2641477...,  0.3777000...])
colour.models.cie_xyy.xy_to_XYZ(xy)[source]

Returns the CIE XYZ tristimulus values from given xy chromaticity coordinates.

Parameters:xy (array_like) – xy chromaticity coordinates.
Returns:CIE XYZ tristimulus values.
Return type:ndarray

Notes

  • Input xy chromaticity coordinates are in domain [0, 1].
  • Output CIE XYZ tristimulus values are in domain [0, 1].

Examples

>>> xy = np.array([0.26414772236966133, 0.37770000704815188])
>>> xy_to_XYZ(xy)  
array([ 0.6993585...,  1.        ,  0.9482453...])
colour.models.cie_xyy.XYZ_to_xy(XYZ, illuminant=(0.34567, 0.3585))[source]

Returns the xy chromaticity coordinates from given CIE XYZ tristimulus values.

Parameters:
  • XYZ (array_like) – CIE XYZ tristimulus values.
  • illuminant (array_like, optional) – Reference illuminant chromaticity coordinates.
Returns:

xy chromaticity coordinates.

Return type:

ndarray

Notes

  • Input CIE XYZ tristimulus values are in domain [0, 1].
  • Output xy chromaticity coordinates are in domain [0, 1].

Examples

>>> XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
>>> XYZ_to_xy(XYZ)  
array([ 0.2641477...,  0.3777000...])