Colorimetry#

Spectral Data Structure#

colour

MultiSpectralDistributions([data, domain, ...])

Define multi-spectral distributions: the base object for multi-spectral computations.

SpectralDistribution([data, domain])

Define the spectral distribution: the base object for spectral computations.

SpectralShape(start, end, interval)

Define the base object for spectral distribution shape.

SPECTRAL_SHAPE_ASTME308

Define the spectral shape for ASTM E308-15 practice with wavelength range from 360 to 780 nm at 1 nm intervals: (360, 780, 1).

SPECTRAL_SHAPE_DEFAULT

Define the spectral shape for ASTM E308-15 practice with wavelength range from 360 to 780 nm at 1 nm intervals: (360, 780, 1).

Ancillary Objects

colour.colorimetry

reshape_msds(msds[, shape, method, copy])

Reshape the specified multi-spectral distributions to match the specified spectral shape.

reshape_sd(sd[, shape, method, copy])

Reshape the specified spectral distribution to match the specified spectral shape.

sds_and_msds_to_msds(sds)

Convert specified spectral and multi-spectral distributions to multi-spectral distributions.

sds_and_msds_to_sds(sds)

Convert specified spectral and multi-spectral distributions to a list of spectral distributions.

Spectral Data Generation#

colour

msds_constant(k, labels[, shape])

Generate multi-spectral distributions with the specified labels and spectral shape filled with constant \(k\) values.

msds_ones(labels[, shape])

Generate multi-spectral distributions with the specified labels and spectral shape filled with ones.

msds_zeros(labels[, shape])

Generate multi-spectral distributions with the specified labels and spectral shape filled with zeros.

sd_blackbody(temperature[, shape, c1, c2, n])

Generate the spectral distribution of the planckian radiator for the specified temperature \(T[K]\) with values in watts per steradian per square metre per nanometre (\(W/sr/m^2/nm\)).

sd_CIE_illuminant_D_series(xy[, ...])

Return the spectral distribution of the specified CIE Illuminant D Series using the specified CIE xy chromaticity coordinates.

sd_CIE_standard_illuminant_A([shape])

Represent typical domestic tungsten-filament lighting according to CIE Standard Illuminant A.

sd_constant(k[, shape])

Generate a spectral distribution of the specified spectral shape filled with constant \(k\) values.

sd_gaussian(mu_peak_wavelength, sigma_fwhm)

Generate a Gaussian spectral distribution with the specified spectral shape using the specified method.

SD_GAUSSIAN_METHODS

Supported gaussian spectral distribution generation methods.

sd_multi_leds(peak_wavelengths[, shape, method])

Generate a multi-LED spectral distribution with the specified spectral shape at specified peak wavelengths.

SD_MULTI_LEDS_METHODS

Supported multi-LED spectral distribution computation methods.

sd_ones([shape])

Generate a spectral distribution of the specified spectral shape filled with ones.

sd_rayleigh_jeans(temperature[, shape])

Generate the spectral distribution of the planckian radiator for the specified temperature \(T[K]\) with values in watts per steradian per square metre per nanometre (\(W/sr/m^2/nm\)) according to the Rayleigh-Jeans law.

sd_single_led(peak_wavelength[, shape, method])

Generate a single LED spectral distribution with the specified spectral shape at the specified peak wavelength using the specified method.

SD_SINGLE_LED_METHODS

Supported single LED spectral distribution computation methods.

sd_zeros([shape])

Generate a spectral distribution of the specified spectral shape filled with zeros.

colour.colorimetry

blackbody_spectral_radiance(wavelength, ...)

Compute the spectral radiance of a blackbody as a function of wavelength at specified thermodynamic temperature \(T[K]\) in a medium with index of refraction \(n\).

daylight_locus_function(x_D)

Compute the CIE y chromaticity coordinate on the daylight locus.

planck_law(wavelength, temperature[, c1, c2, n])

Compute the spectral radiance of a blackbody as a function of wavelength at specified thermodynamic temperature \(T[K]\) in a medium with index of refraction \(n\).

rayleigh_jeans_law(wavelength, temperature)

Approximate the spectral radiance of a blackbody as a function of wavelength at specified thermodynamic temperature \(T[K]\) according to the Rayleigh-Jeans law.

sd_gaussian_fwhm(peak_wavelength, fwhm[, shape])

Generate a Gaussian spectral distribution of the specified spectral shape at specified peak wavelength and full width at half maximum (FWHM).

sd_gaussian_normal(mu, sigma[, shape])

Generate a Gaussian spectral distribution of the specified spectral shape at specified mean wavelength \(\mu\) and standard deviation \(\sigma\).

sd_gaussian_super_clamped(peak_wavelength, fwhm)

Generate a super-Gaussian spectral distribution, optionally clamped flat on one side of the peak, with the peak normalized to 1.

sd_multi_leds_Ohno2005(peak_wavelengths, ...)

Generate a multi-LED spectral distribution with the specified spectral shape at specified peak wavelengths, half spectral widths \(\Delta\lambda_{0.5}\), and peak power ratios according to the Ohno (2005) method.

sd_single_led_Ohno2005(peak_wavelength, ...)

Generate a single LED spectral distribution with the specified spectral shape at specified peak wavelength and half spectral width \(\Delta\lambda_{0.5}\) using Ohno (2005) method.

Aliases

colour.colorimetry

planck_law(wavelength, temperature[, c1, c2, n])

Compute the spectral radiance of a blackbody as a function of wavelength at specified thermodynamic temperature \(T[K]\) in a medium with index of refraction \(n\).

Conversion to Tristimulus Values#

colour

msds_to_XYZ(msds[, cmfs, illuminant, k, method])

Convert specified multi-spectral distributions to CIE XYZ tristimulus values using the specified colour matching functions and illuminant.

MSDS_TO_XYZ_METHODS

Supported multi-spectral distributions to CIE XYZ tristimulus values conversion methods.

sd_to_XYZ(sd[, cmfs, illuminant, k, method])

Convert specified spectral distribution to CIE XYZ tristimulus values using specified colour matching functions, illuminant and method.

SD_TO_XYZ_METHODS

Supported spectral distribution to CIE XYZ tristimulus values conversion methods.

wavelength_to_XYZ(wavelength[, cmfs])

Convert the specified wavelength \(\lambda\) to CIE XYZ tristimulus values using the specified colour matching functions.

Ancillary Objects

colour.colorimetry

handle_spectral_arguments([cmfs, ...])

Handle spectral arguments for various Colour definitions that perform spectral computations.

ASTM E308-15#

colour.colorimetry

msds_to_XYZ_ASTME308(msds[, cmfs, ...])

Convert specified multi-spectral distributions to CIE XYZ tristimulus values using the specified colour matching functions and illuminant according to practise ASTM E308-15 method.

sd_to_XYZ_ASTME308(sd[, cmfs, illuminant, ...])

Convert the specified spectral distribution to CIE XYZ tristimulus values using the specified colour matching functions and illuminant according to practice ASTM E308-15 method.

Ancillary Objects

colour.colorimetry

adjust_tristimulus_weighting_factors_ASTME308(W, ...)

Adjust the specified table of tristimulus weighting factors to account for a shorter wavelength range of the test spectral shape compared to the reference spectral shape using practice ASTM E308-15 method.

lagrange_coefficients_ASTME2022([interval, ...])

Compute Lagrange Coefficients for the specified interval size using practice ASTM E2022-11 method.

sd_to_XYZ_tristimulus_weighting_factors_ASTME308(sd)

Convert the specified spectral distribution to CIE XYZ tristimulus values using the specified colour matching functions and illuminant with a table of tristimulus weighting factors according to the ASTM E308-15 method.

tristimulus_weighting_factors_ASTME2022(...)

Compute a table of tristimulus weighting factors for the specified colour matching functions and illuminant using practise ASTM E2022-11 method.

Integration#

colour.colorimetry

msds_to_XYZ_integration(msds[, cmfs, ...])

Convert the specified multi-spectral distributions to CIE XYZ tristimulus values using the specified colour matching functions and illuminant.

sd_to_XYZ_integration(sd[, cmfs, ...])

Convert the specified spectral distribution to CIE XYZ tristimulus values using the specified colour matching functions and illuminant using the classical integration method.

Spectral Bandpass Dependence Correction#

colour

bandpass_correction(sd[, method])

Apply spectral bandpass dependence correction to the specified spectral distribution.

BANDPASS_CORRECTION_METHODS

Supported spectral bandpass dependence correction methods.

Stearns and Stearns (1988)#

colour.colorimetry

bandpass_correction_Stearns1988(sd)

Apply spectral bandpass dependence correction to the specified spectral distribution using Stearns and Stearns (1988) method.

Colour Matching Functions#

colour.colorimetry

LMS_ConeFundamentals([data, domain, labels])

Define a container for Stockman and Sharpe LMS cone fundamentals colour matching functions.

RGB_ColourMatchingFunctions([data, domain, ...])

Define a container for CIE RGB colour matching functions.

XYZ_ColourMatchingFunctions([data, domain, ...])

Define a container for CIE Standard Observers XYZ colour matching functions.

Dataset

colour

MSDS_CMFS

Multi-spectral distributions of the colour matching functions.

Ancillary Objects

colour.colorimetry

MSDS_CMFS_LMS

Multi-spectral distributions of the LMS colour matching functions.

MSDS_CMFS_RGB

Multi-spectral distributions of the RGB colour matching functions.

MSDS_CMFS_STANDARD_OBSERVER

Multi-spectral distributions of the CIE Standard Observer colour matching functions.

Colour Matching Functions Transformations#

Ancillary Objects

colour.colorimetry

LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(...)

Convert the Stockman & Sharpe 10 Degree Cone Fundamentals colour matching functions to the CIE 2015 10 Degree Standard Observer colour matching functions.

LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(...)

Convert the Stockman & Sharpe 2 Degree Cone Fundamentals colour matching functions to the CIE 2015 2 Degree Standard Observer colour matching functions.

RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(...)

Convert the Stiles & Burch 1959 10 Degree RGB CMFs colour matching functions to the Stockman & Sharpe 10 Degree Cone Fundamentals spectral sensitivity functions.

RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(...)

Convert the Stiles & Burch 1959 10 Degree RGB CMFs colour matching functions to the CIE 1964 10 Degree Standard Observer colour matching functions.

RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(...)

Convert the Wright & Guild 1931 2 Degree RGB CMFs colour matching functions to the CIE 1931 2 Degree Standard Observer colour matching functions.

Illuminants and Light Sources#

Dataset

colour

CCS_ILLUMINANTS

Chromaticity coordinates of the illuminants.

CCS_LIGHT_SOURCES

Chromaticity coordinates of the light sources.

SDS_ILLUMINANTS

Spectral distributions of the illuminants.

SDS_LIGHT_SOURCES

Spectral distributions of the light sources.

TVS_ILLUMINANTS

CIE XYZ tristimulus values of the illuminants.

TVS_ILLUMINANTS_HUNTERLAB

CIE XYZ tristimulus values of the HunterLab illuminants.

Ancillary Objects

colour.colorimetry

SDS_BASIS_FUNCTIONS_CIE_ILLUMINANT_D_SERIES

CIE Illuminant D Series \(S_n(\lambda)\) basis function spectral distributions.

Dominant Wavelength and Purity#

colour

colorimetric_purity(xy, xy_n[, cmfs])

Compute the colorimetric purity \(P_c\) for the specified colour stimulus \(xy\).

complementary_wavelength(xy, xy_n[, cmfs])

Compute the complementary wavelength \(\lambda_c\) for the specified colour stimulus \(xy\) and the related \(xy_wl\) first and \(xy_{cw}\) second intersection coordinates with the spectral locus.

dominant_wavelength(xy, xy_n[, cmfs, inverse])

Compute the dominant wavelength \(\lambda_d\) for colour stimulus \(xy\) and the related \(xy_wl\) first and \(xy_{cw}\) second intersection coordinates with the spectral locus.

excitation_purity(xy, xy_n[, cmfs])

Compute the excitation purity \(P_e\) for the specified colour stimulus \(xy\).

Luminous Efficiency Functions#

colour

luminous_efficacy(sd[, lef])

Compute the luminous efficacy in \(lm\cdot W^{-1}\) of the specified spectral distribution using the specified luminous efficiency function.

luminous_efficiency(sd[, lef])

Compute the luminous efficiency of the specified spectral distribution using specified luminous efficiency function.

luminous_flux(sd[, lef, K_m])

Compute the luminous flux for the specified spectral distribution using the specified luminous efficiency function.

sd_mesopic_luminous_efficiency_function(L_p)

Return the mesopic luminous efficiency function \(V_m(\lambda)\) for the specified photopic luminance \(L_p\).

Dataset

colour

SDS_LEFS

Spectral distributions of the luminous efficiency functions.

Ancillary Objects

colour.colorimetry

SDS_LEFS_PHOTOPIC

Spectral distributions of the photopic luminous efficiency functions.

SDS_LEFS_SCOTOPIC

Spectral distributions of the scotopic luminous efficiency functions.

Spectral Uniformity#

colour

spectral_uniformity(sds[, ...])

Compute the spectral uniformity (or spectral flatness) of the specified spectral distributions.

Lightness Computation#

colour

lightness(Y[, method])

Compute the lightness \(L\) from the specified luminance \(Y\).

LIGHTNESS_METHODS

Supported lightness computation methods.

Glasser, Mckinney, Reilly and Schnelle (1958)#

colour.colorimetry

lightness_Glasser1958(Y)

Compute lightness \(L\) from the specified luminance \(Y\) using the Glasser et al. (1958) method.

Wyszecki (1963)#

colour.colorimetry

lightness_Wyszecki1963(Y)

Compute lightness \(W\) from the specified luminance \(Y\) using the Wyszecki (1963) method.

CIE 1976#

colour.colorimetry

intermediate_lightness_function_CIE1976(Y[, Y_n])

Compute the intermediate value \(f(Y/Y_n)\) from the specified luminance \(Y\) using the specified reference white luminance \(Y_n\) as per CIE 1976 recommendation.

lightness_CIE1976(Y[, Y_n])

Compute the lightness \(L^*\) of the specified luminance \(Y\) using the specified reference white luminance \(Y_n\) as per CIE 1976 recommendation.

Fairchild and Wyble (2010)#

colour.colorimetry

lightness_Fairchild2010(Y[, epsilon])

Compute lightness \(L_{hdr}\) from the specified luminance \(Y\) using Fairchild and Wyble (2010) method according to Michaelis-Menten kinetics.

Fairchild and Chen (2011)#

colour.colorimetry

lightness_Fairchild2011(Y[, epsilon, method])

Compute lightness \(L_{hdr}\) from the specified luminance \(Y\) using Fairchild and Chen (2011) method according to Michaelis-Menten kinetics.

Abebe, Pouli, Larabi and Reinhard (2017)#

colour.colorimetry

lightness_Abebe2017(Y[, Y_n, method])

Compute lightness \(L\) from the specified luminance \(Y\) using Abebe, Pouli, Larabi and Reinhard (2017) adaptive method for high-dynamic-range imaging according to Michaelis-Menten kinetics or Stevens's Power Law.

Luminance Computation#

colour

luminance(LV[, method])

Compute the luminance \(Y\) from the specified lightness \(L^*\) or Munsell value \(V\).

LUMINANCE_METHODS

Supported luminance computation methods.

Newhall, Nickerson and Judd (1943)#

colour.colorimetry

luminance_Newhall1943(V)

Compute the luminance \(R_Y\) from the specified Munsell value \(V\) using Newhall et al. (1943) method.

CIE 1976#

colour.colorimetry

intermediate_luminance_function_CIE1976(f_Y_Y_n)

Compute luminance \(Y\) from the specified intermediate value \(f(Y/Y_n)\) using the specified reference white luminance \(Y_n\) as per CIE 1976 recommendation.

luminance_CIE1976(L_star[, Y_n])

Compute the luminance \(Y\) from the specified lightness \(L^*\) with the specified reference white luminance \(Y_n\).

ASTM D1535-08e1#

colour.colorimetry

luminance_ASTMD1535(V)

Compute luminance \(Y\) from the specified Munsell value \(V\) using ASTM D1535-08e1 method.

Fairchild and Wyble (2010)#

colour.colorimetry

luminance_Fairchild2010(L_hdr[, epsilon])

Compute luminance \(Y\) from the specified lightness \(L_{hdr}\) using Fairchild and Wyble (2010) method according to Michaelis-Menten kinetics.

Fairchild and Chen (2011)#

colour.colorimetry

luminance_Fairchild2011(L_hdr[, epsilon, method])

Compute luminance \(Y\) from the specified lightness \(L_{hdr}\) using Fairchild and Chen (2011) method according to Michaelis-Menten kinetics.

Whiteness Computation#

colour

whiteness(XYZ, XYZ_0[, method])

Compute the whiteness index \(W\) of the specified sample CIE XYZ tristimulus values using the specified method.

WHITENESS_METHODS

Supported whiteness computation methods.

Berger (1959)#

colour.colorimetry

whiteness_Berger1959(XYZ, XYZ_0)

Compute the whiteness index \(WI\) of the specified sample CIE XYZ tristimulus values using the Berger (1959) method.

Taube (1960)#

colour.colorimetry

whiteness_Taube1960(XYZ, XYZ_0)

Compute the whiteness index \(WI\) of the specified sample CIE XYZ tristimulus values using the Taube (1960) method.

Stensby (1968)#

colour.colorimetry

whiteness_Stensby1968(Lab)

Compute the whiteness index \(WI\) of the specified sample CIE L*a*b* colourspace array using the Stensby (1968) method.

ASTM E313#

colour.colorimetry

whiteness_ASTME313(XYZ)

Compute the whiteness index \(WI\) of the specified sample CIE XYZ tristimulus values using the ASTM E313 method.

Ganz and Griesser (1979)#

colour.colorimetry

whiteness_Ganz1979(xy, Y)

Compute the whiteness index \(W\) and tint \(T\) of the specified sample CIE xy chromaticity coordinates using the Ganz and Griesser (1979) method.

CIE 2004#

colour.colorimetry

whiteness_CIE2004(xy, Y, xy_n[, observer])

Compute the whiteness \(W\) or \(W_{10}\) and tint \(T\) or \(T_{10}\) of the specified sample CIE xy chromaticity coordinates using the CIE 2004 method.

Yellowness Computation#

colour

yellowness(XYZ[, method])

Compute the yellowness index \(YI\) using the specified method.

YELLOWNESS_METHODS

Supported yellowness computation methods.

ASTM D1925#

colour.colorimetry

yellowness_ASTMD1925(XYZ)

Compute the yellowness index \(YI\) of the specified sample CIE XYZ tristimulus values using the ASTM D1925 method.

ASTM E313#

colour.colorimetry

yellowness_ASTME313(XYZ[, C_XZ])

Compute the yellowness index \(YI\) of the specified sample CIE XYZ tristimulus values using the ASTM E313 method.

yellowness_ASTME313_alternative(XYZ)

Compute the yellowness index \(YI\) of the specified sample CIE XYZ tristimulus values using the alternative ASTM E313 method.

YELLOWNESS_COEFFICIENTS_ASTME313

Coefficients \(C_X\) and \(C_Z\) for the ASTM E313 yellowness index \(YI\) computation method.