colour.sRGB_to_XYZ

colour.sRGB_to_XYZ(RGB, illuminant=array([ 0.3127, 0.329 ]), chromatic_adaptation_method='CAT02', apply_decoding_cctf=True)[source]

Converts from sRGB colourspace to CIE XYZ tristimulus values.

Parameters:
  • RGB (array_like) – sRGB colourspace array.
  • illuminant (array_like, optional) – Source illuminant chromaticity coordinates.
  • chromatic_adaptation_method (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02_BRILL_CAT’, ‘Bianco’, ‘Bianco PC’}, Chromatic adaptation method.
  • apply_decoding_cctf (bool, optional) – Apply sRGB decoding colour component transfer function / electro-optical transfer function.
Returns:

CIE XYZ tristimulus values.

Return type:

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)  # doctest: +ELLIPSIS
array([ 0.2065429...,  0.1219794...,  0.0513714...])