colour.recovery.RGB_to_sd_Gaussian#

colour.recovery.RGB_to_sd_Gaussian(RGB: Domain1) SpectralDistribution[source]#

Recover the spectral distribution of the specified RGB colourspace array using Gaussian basis spectra and the Smits (1999) decomposition algorithm.

Parameters:

RGB (Domain1) – RGB colourspace array to recover the spectral distribution from.

Returns:

Recovered spectral distribution.

Return type:

colour.SpectralDistribution

Notes

Domain

Scale - Reference

Scale - 1

RGB

1

1

Examples

>>> import numpy as np
>>> from colour import MSDS_CMFS, SDS_ILLUMINANTS, SpectralShape
>>> from colour.colorimetry import sd_to_XYZ_integration
>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> RGB = XYZ_to_RGB_Gaussian(XYZ)
>>> cmfs = (
...     MSDS_CMFS["CIE 1931 2 Degree Standard Observer"]
...     .copy()
...     .align(SpectralShape(360, 780, 10))
... )
>>> illuminant = SDS_ILLUMINANTS["E"].copy().align(cmfs.shape)
>>> sd = RGB_to_sd_Gaussian(RGB)
>>> sd_to_XYZ_integration(sd, cmfs, illuminant) / 100
array([0.19324..., 0.11592..., 0.04332...])