colour.XYZ_to_sRGB#

colour.XYZ_to_sRGB(XYZ: Domain1, illuminant: ArrayLike = CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65'], chromatic_adaptation_transform: LiteralChromaticAdaptationTransform | str | None = 'CAT02', apply_cctf_encoding: bool = True) Range1[source]#

Convert from CIE XYZ tristimulus values to sRGB colourspace.

Parameters:
  • XYZ (Domain1) – CIE XYZ tristimulus values.

  • illuminant (ArrayLike) – Source illuminant chromaticity coordinates.

  • chromatic_adaptation_transform (LiteralChromaticAdaptationTransform | str | None) – Chromatic adaptation transform.

  • apply_cctf_encoding (bool) – Whether to apply the sRGB encoding colour component transfer function / inverse electro-optical transfer function.

Returns:

sRGB colour array.

Return type:

numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

XYZ

1

1

Range

Scale - Reference

Scale - 1

RGB

1

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...])