colour.XYZ_to_sRGB

colour.XYZ_to_sRGB(XYZ, illuminant=array([0.3127, 0.329]), chromatic_adaptation_transform='CAT02', apply_cctf_encoding=True, **kwargs)[source]

Converts from CIE XYZ tristimulus values to sRGB colourspace.

Parameters
  • XYZ (array_like) – CIE XYZ tristimulus values.

  • illuminant (array_like, optional) – Source illuminant chromaticity coordinates.

  • chromatic_adaptation_transform (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02_BRILL_CAT’, ‘Bianco’, ‘Bianco PC’}, Chromatic adaptation transform.

  • apply_cctf_encoding (bool, optional) – Apply sRGB encoding colour component transfer function / opto-electronic transfer function.

Other Parameters

**kwargs (dict, optional) – Keywords arguments for deprecation management.

Returns

sRGB colour array.

Return type

ndarray

Notes

Domain

Scale - Reference

Scale - 1

XYZ

[0, 1]

[0, 1]

Range

Scale - Reference

Scale - 1

RGB

[0, 1]

[0, 1]

Examples

>>> import numpy as np
>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> XYZ_to_sRGB(XYZ)  
array([ 0.7057393...,  0.1924826...,  0.2235416...])