colour.sRGB_to_XYZ#

colour.sRGB_to_XYZ(RGB: ArrayLike, illuminant: ArrayLike = CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65'], chromatic_adaptation_transform: Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02', 'CAT02 Brill 2008', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'] | str | None = 'CAT02', apply_cctf_decoding: bool = True) NDArrayFloat[source]#

Convert from sRGB colourspace to CIE XYZ tristimulus values.

Parameters:
  • RGB (ArrayLike) – sRGB colourspace array.

  • illuminant (ArrayLike) – Source illuminant chromaticity coordinates.

  • chromatic_adaptation_transform (Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02', 'CAT02 Brill 2008', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'] | str | None) – Chromatic adaptation transform.

  • apply_cctf_decoding (bool) – Whether to apply the sRGB decoding colour component transfer function / electro-optical transfer function.

Returns:

CIE XYZ tristimulus values.

Return type:

numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

RGB

[0, 1]

[0, 1]

Range

Scale - Reference

Scale - 1

XYZ

[0, 1]

[0, 1]

Examples

>>> import numpy as np
>>> RGB = np.array([0.70573936, 0.19248266, 0.22354169])
>>> sRGB_to_XYZ(RGB)  
array([ 0.2065429...,  0.1219794...,  0.0513714...])