colour.recovery.XYZ_to_sd_Jakob2019

colour.recovery.XYZ_to_sd_Jakob2019(XYZ, cmfs=None, illuminant=None, optimisation_kwargs=None, additional_data=False)[source]

Recovers the spectral distribution of given RGB colourspace array using Jakob and Hanika (2019) method.

Parameters
  • XYZ (array_like, (3,)) – CIE XYZ tristimulus values to recover the spectral distribution from.

  • cmfs (XYZ_ColourMatchingFunctions, optional) – Standard observer colour matching functions, default to the CIE 1931 2 Degree Standard Observer.

  • illuminant (SpectralDistribution, optional) – Illuminant spectral distribution, default to CIE Standard Illuminant D65.

  • optimisation_kwargs (dict_like, optional) – Parameters for colour.recovery.find_coefficients_Jakob2019() definition.

  • additional_data (bool, optional) – If True, error will be returned alongside sd.

Returns

  • sd (SpectralDistribution) – Recovered spectral distribution.

  • error (float) – \(\Delta E_{76}\) between the target colour and the colour corresponding to the computed coefficients.

References

[JH19]

Examples

>>> from colour import (
...     CCS_ILLUMINANTS, MSDS_CMFS, SDS_ILLUMINANTS, XYZ_to_sRGB)
>>> from colour.colorimetry import sd_to_XYZ_integration
>>> from colour.utilities import numpy_print_options
>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> cmfs = (
...     MSDS_CMFS['CIE 1931 2 Degree Standard Observer'].
...     copy().align(SpectralShape(360, 780, 10))
... )
>>> illuminant = SDS_ILLUMINANTS['D65'].copy().align(cmfs.shape)
>>> sd = XYZ_to_sd_Jakob2019(XYZ, cmfs, illuminant)
>>> with numpy_print_options(suppress=True):
...     sd  
SpectralDistribution([[ 360.        ,    0.4893773...],
                      [ 370.        ,    0.3258214...],
                      [ 380.        ,    0.2147792...],
                      [ 390.        ,    0.1482413...],
                      [ 400.        ,    0.1086169...],
                      [ 410.        ,    0.0841255...],
                      [ 420.        ,    0.0683114...],
                      [ 430.        ,    0.0577144...],
                      [ 440.        ,    0.0504267...],
                      [ 450.        ,    0.0453552...],
                      [ 460.        ,    0.0418520...],
                      [ 470.        ,    0.0395259...],
                      [ 480.        ,    0.0381430...],
                      [ 490.        ,    0.0375741...],
                      [ 500.        ,    0.0377685...],
                      [ 510.        ,    0.0387432...],
                      [ 520.        ,    0.0405871...],
                      [ 530.        ,    0.0434783...],
                      [ 540.        ,    0.0477225...],
                      [ 550.        ,    0.0538256...],
                      [ 560.        ,    0.0626314...],
                      [ 570.        ,    0.0755869...],
                      [ 580.        ,    0.0952675...],
                      [ 590.        ,    0.1264265...],
                      [ 600.        ,    0.1779272...],
                      [ 610.        ,    0.2649393...],
                      [ 620.        ,    0.4039779...],
                      [ 630.        ,    0.5832105...],
                      [ 640.        ,    0.7445440...],
                      [ 650.        ,    0.8499970...],
                      [ 660.        ,    0.9094792...],
                      [ 670.        ,    0.9425378...],
                      [ 680.        ,    0.9616376...],
                      [ 690.        ,    0.9732481...],
                      [ 700.        ,    0.9806562...],
                      [ 710.        ,    0.9855873...],
                      [ 720.        ,    0.9889903...],
                      [ 730.        ,    0.9914117...],
                      [ 740.        ,    0.9931801...],
                      [ 750.        ,    0.9945009...],
                      [ 760.        ,    0.9955066...],
                      [ 770.        ,    0.9962855...],
                      [ 780.        ,    0.9968976...]],
                     interpolator=SpragueInterpolator,
                     interpolator_kwargs={},
                     extrapolator=Extrapolator,
                     extrapolator_kwargs={...})
>>> sd_to_XYZ_integration(sd, cmfs, illuminant) / 100  
array([ 0.2066217...,  0.1220128...,  0.0513958...])