Defines objects for tristimulus values computation from spectral data.
Converts given spectral power distribution to CIE XYZ colourspace using given colour matching functions and illuminant.
Parameters: |
|
---|---|
Returns: | CIE XYZ colourspace matrix. |
Return type: | ndarray, (3,) |
Warning
The output domain of that definition is non standard!
Notes
References
[1] | Wyszecki, G., & Stiles, W. S. (2000). Integration Replace by Summation. In Color Science: Concepts and Methods, Quantitative Data and Formulae (pp. 158–163). Wiley. ISBN:978-0471399186 |
Examples
>>> from colour import CMFS, ILLUMINANTS_RELATIVE_SPDS, SpectralPowerDistribution
>>> cmfs = CMFS.get('CIE 1931 2 Degree Standard Observer')
>>> data = {380: 0.0600, 390: 0.0600}
>>> spd = SpectralPowerDistribution('Custom', data)
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('D50')
>>> spectral_to_XYZ(spd, cmfs, illuminant)
array([ 4.5764852...e-04, 1.2964866...e-05, 2.1615807...e-03])
Converts given wavelength \(\lambda\) to CIE XYZ colourspace using given colour matching functions.
If the wavelength \(\lambda\) is not available in the colour matching function, its value will be calculated using CIE recommendations: The method developed by Sprague (1880) should be used for interpolating functions having a uniformly spaced independent variable and a Cubic Spline method for non-uniformly spaced independent variable.
Parameters: |
|
---|---|
Returns: | CIE XYZ colourspace matrix. |
Return type: | ndarray, (3,) |
Raises: | ValueError – If wavelength \(\lambda\) is not in the colour matching functions domain. |
Notes
Examples
>>> from colour import CMFS
>>> cmfs = CMFS.get('CIE 1931 2 Degree Standard Observer')
>>> wavelength_to_XYZ(480)
array([ 0.09564 , 0.13902 , 0.812950...])