colour.sRGB_to_XYZ¶
- colour.sRGB_to_XYZ(RGB, illuminant=array([0.3127, 0.329]), chromatic_adaptation_method='CAT02', apply_cctf_decoding=True, **kwargs)[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 2008’, ‘Bianco 2010’, ‘Bianco PC 2010’}, Chromatic adaptation method.
apply_cctf_decoding (bool, optional) – Apply sRGB decoding colour component transfer function / electro-optical transfer function.
**kwargs (dict, optional) – Keywords arguments for deprecation management.
- 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) array([ 0.2065429..., 0.1219794..., 0.0513714...])