colour.xy_to_xyY#

colour.xy_to_xyY(xy: ArrayLike, Y: float = 1) NDArrayFloat[source]#

Convert from CIE xy chromaticity coordinates to CIE xyY colourspace by extending the array last dimension with given \(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 (ArrayLike) – CIE xy chromaticity coordinates or CIE xyY colourspace array.

  • Y (float) – Optional \(Y\) luminance value used to construct the CIE xyY colourspace array, the default \(Y\) luminance value is 1.

Returns:

CIE xyY colourspace array.

Return type:

numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

xy

[0, 1]

[0, 1]

Range

Scale - Reference

Scale - 1

xyY

[0, 1]

[0, 1]

  • This definition is a convenient object provided to implement support of illuminant argument luminance value in various colour.models package objects such as colour.Lab_to_XYZ() or colour.Luv_to_XYZ().

References

[CIET14804f], [Wikipedia05d]

Examples

>>> xy = np.array([0.54369557, 0.32107944])
>>> xy_to_xyY(xy)  
array([ 0.5436955...,  0.3210794...,  1.        ])
>>> xy = np.array([0.54369557, 0.32107944, 1.00000000])
>>> xy_to_xyY(xy)  
array([ 0.5436955...,  0.3210794...,  1.        ])
>>> xy = np.array([0.54369557, 0.32107944])
>>> xy_to_xyY(xy, 100)  
array([   0.5436955...,    0.3210794...,  100.        ])