colour.recovery.XYZ_to_sd_Jakob2019

colour.recovery.XYZ_to_sd_Jakob2019(XYZ, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), illuminant=SpectralDistribution(name='D65', ...), optimisation_kwargs=None, additional_data=False)[source]

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

Parameters
Returns

  • sd (SpectralDistribution) – Recovered spectral distribution.

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

References

[]

Examples

>>> from colour.colorimetry import CCS_ILLUMINANTS, sd_to_XYZ_integration
>>> from colour.models import XYZ_to_sRGB
>>> from colour.utilities import numpy_print_options
>>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
>>> cmfs = (
...     MSDS_CMFS_STANDARD_OBSERVER['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):
...     # Doctests skip for Python 2.x compatibility.
...     sd  
SpectralDistribution([[ 360.        ,    0.4884502...],
                      [ 370.        ,    0.3251871...],
                      [ 380.        ,    0.2144337...],
                      [ 390.        ,    0.1480663...],
                      [ 400.        ,    0.1085298...],
                      [ 410.        ,    0.0840835...],
                      [ 420.        ,    0.0682934...],
                      [ 430.        ,    0.0577098...],
                      [ 440.        ,    0.0504300...],
                      [ 450.        ,    0.0453634...],
                      [ 460.        ,    0.0418635...],
                      [ 470.        ,    0.0395397...],
                      [ 480.        ,    0.0381585...],
                      [ 490.        ,    0.0375912...],
                      [ 500.        ,    0.0377870...],
                      [ 510.        ,    0.0387631...],
                      [ 520.        ,    0.0406086...],
                      [ 530.        ,    0.0435015...],
                      [ 540.        ,    0.0477476...],
                      [ 550.        ,    0.0538528...],
                      [ 560.        ,    0.0626607...],
                      [ 570.        ,    0.0756177...],
                      [ 580.        ,    0.0952978...],
                      [ 590.        ,    0.1264501...],
                      [ 600.        ,    0.1779277...],
                      [ 610.        ,    0.2648782...],
                      [ 620.        ,    0.4037993...],
                      [ 630.        ,    0.5829234...],
                      [ 640.        ,    0.7442651...],
                      [ 650.        ,    0.8497961...],
                      [ 660.        ,    0.9093483...],
                      [ 670.        ,    0.9424527...],
                      [ 680.        ,    0.9615805...],
                      [ 690.        ,    0.9732085...],
                      [ 700.        ,    0.9806277...],
                      [ 710.        ,    0.9855663...],
                      [ 720.        ,    0.9889743...],
                      [ 730.        ,    0.9913993...],
                      [ 740.        ,    0.9931703...],
                      [ 750.        ,    0.9944931...],
                      [ 760.        ,    0.9955002...],
                      [ 770.        ,    0.9962802...],
                      [ 780.        ,    0.9968932...]],
                     interpolator=SpragueInterpolator,
                     interpolator_kwargs={},
                     extrapolator=Extrapolator,
                     extrapolator_kwargs={...})
>>> sd_to_XYZ_integration(sd, cmfs, illuminant) / 100  
array([ 0.2065841...,  0.1220125...,  0.0514023...])