Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Colour 0.4.0 - Current Changes

Colour 0.4.0 - Alpha Milestone

Features

colour.characterisation

  • Various ACES Input Device Transform computation objects have been updated to generate additional data and support more features for the Academy Input Device Transform (IDT) calculator. (@KelSolaar, @aforsythe)
  • Add colour.camera_RGB_to_ACES2065_1 definition. (@KelSolaar, @aforsythe)

colour.colorimetry

  • Add colour.TVS_ILLUMINANTS attribute providing a reference for the CIE XYZ tristimulus values of the CIE illuminants. (@KelSolaar)
  • Ensure that colour.SpectralShape and dict KeysView class instances can be passed as domain to colour.SpectralDistribution and colour.MutliSpectralDistributions classes. (@KelSolaar)
  • The colour.colorimetry.yellowness_ASTME313 definition has been updated to use the recommended Yellowness Index equation as given by ASTME313. The alternative method has been renamed to colour.colorimetry.yellowness_ASTME313_alternative. (@KelSolaar, @romanovar)

colour.difference

  • Implement support for STRESS index computation according to García et al. (2007) method with colour.index_stress definition and colour.INDEX_STRESS_METHODS attribute. (@KelSolaar)
  • Implement support for Huang et al. (2015) power-functions improving colour-difference formulas with colour.difference.power_function_Huang2015 definition. (@KelSolaar)

colour.models

  • Implement support for R'G'B' to Y'CbCr matrices computation with colour.matrix_YCbCr and colour.offset_YCbCr definitions. (@KelSolaar, @nick-shaw)

  • Implement support for Nikon N-Gamut and N-Log with colour.models.RGB_COLOURSPACE_N_GAMUT class and colour.models.log_encoding_NLOG and colour.models.log_decoding_NLOG definitions. (@sobotka, @KelSolaar)

  • Implement support for DaVinci Intermediate OETF and its inverse with colour.models.oetf_DaVinciIntermediate and colour.models.oetf_inverse_DaVinciIntermediate definitions. (@fredsavoir, @KelSolaar)

  • Implement support for Oklab colourspace with colour.XYZ_to_Oklab and colour.Oklab_to_XYZ definitions. (@KelSolaar)

  • Implement wrapper colour.XYZ_to_ICTCP and colour.ICTCP_to_XYZ definitions. (@KelSolaar)

  • Implement wrapper colour.XYZ_to_CAM02LCD, colour.CAM02LCD_to_XYZ, colour.XYZ_to_CAM02SCD, colour.CAM02SCD_to_XYZ, colour.XYZ_to_CAM02UCS and colour.CAM02UCS_to_XYZ definitions. (@KelSolaar)

  • Implement wrapper colour.XYZ_to_CAM16LCD, colour.CAM16LCD_to_XYZ, colour.XYZ_to_CAM16SCD, colour.CAM16SCD_to_XYZ, colour.XYZ_to_CAM16UCS and colour.CAM16UCS_to_XYZ definitions. (@KelSolaar)

  • Implement support for RED Log3G10 encoding and decoding curves that uses a linear extension as given in the final version of White Paper on REDWideGamutRGB and Log3G10. (@jedypod)

  • Implement support for Sarifuddin and Missaoui (2005) HCL colourspace with colour.RGB_to_HCL and colour.HCL_to_RGB definitions. (@Saransh-cpp, @KelSolaar)

colour.volume

  • Implement support to generate the Rösch-MacAdam colour solid hue lines with the colour.volume.XYZ_outer_surface/colour.volume.solid_RochMacAdam definition. (@KelSolaar)
import colour

figure, axes = colour.plotting.plot_chromaticity_diagram_CIE1931(
    standalone=False)

bins = len(colour.volume.spectrum.SPECTRAL_SHAPE_OUTER_SURFACE_XYZ.range())

xy = colour.XYZ_to_xy(
    solid_RochMacAdam(
        point_order='Pulse Wave Width', filter_jagged_points=True)[1:-1])

for i, j in enumerate(range(0, xy.shape[0], (bins - 1) // 2)):
    hue_lines = np.vstack([xy[j:j + (bins - 1) // 2, :], xy[-1]])
    axes.plot(hue_lines[:, 0], hue_lines[:, 1], c='k')

colour.plotting.render()

image

Fixes

colour

  • Ensure that colour runs on iOS and iPadOS. (@KelSolaar)

image

colour.colorimetry

  • Ensure that the cache used by colour.sd_to_XYZ definition returns a copy of the data. (@KelSolaar)

Changes

colour.algebra

Object Signature Author
colour.algebra.lerp lerp(x, a=0, b=1, clip=False) @KelSolaar

colour.characterisation

Object Signature Author
colour.matrix_idt matrix_idt(sensitivities, illuminant, training_data=None, cmfs=MSDS_CMFS['CIE 1931 2 Degree Standard Observer'].copy().align(SPECTRAL_SHAPE_RAWTOACES), optimisation_factory=optimisation_factory_rawtoaces_v1, optimisation_kwargs=None, chromatic_adaptation_transform='CAT02', additional_data=False) @KelSolaar
colour.characterisation.training_data_sds_to_XYZ training_data_sds_to_XYZ(training_data, cmfs, illuminant, chromatic_adaptation_transform='CAT02') ...

colour.colorimetry

Object Signature Author
colour.colorimetry.sd_gaussian_fwhm sd_gaussian_fwhm(peak_wavelength, fwhm, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) @KelSolaar
colour.colorimetry.sd_gaussian_normal sd_gaussian_normal(mu, sigma, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.colorimetry.sd_single_led_Ohno2005 sd_single_led_Ohno2005(peak_wavelength, fwhm, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.colorimetry.yellowness_ASTME313 yellowness_ASTME313(XYZ, C_XZ=YELLOWNESS_COEFFICIENTS_ASTME313['CIE 1931 2 Degree Standard Observer']['D65'])) ...
colour.msds_constant msds_constant(k, labels, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.msds_ones msds_ones(labels, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.msds_zeros msds_zeros(labels, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.sd_constant sd_constant(k, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.sd_gaussian sd_gaussian(mu_peak_wavelength, sigma_fwhm, shape=SPECTRAL_SHAPE_DEFAULT, method='Normal', **kwargs) ...
colour.sd_multi_leds_Ohno2005 sd_multi_leds_Ohno2005(peak_wavelengths, fwhm, peak_power_ratios=None, shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.sd_multi_leds sd_multi_leds(peak_wavelengths, fwhm, peak_power_ratios=None, shape=SPECTRAL_SHAPE_DEFAULT, method='Ohno 2005', **kwargs) ...
colour.sd_ones sd_ones(shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.sd_single_led sd_single_led(peak_wavelength, fwhm, shape=SPECTRAL_SHAPE_DEFAULT, method='Ohno 2005', **kwargs) ...
colour.sd_zeros sd_zeros(shape=SPECTRAL_SHAPE_DEFAULT, **kwargs) ...
colour.yellowness yellowness(XYZ, method='ASTM E313', **kwargs) ...

colour.io

Object Signature Author
colour.read_spectral_data_from_csv_file read_spectral_data_from_csv_file(path, **kwargs) @KelSolaar
colour.read_sds_from_csv_file read_sds_from_csv_file(path, **kwargs) ...
colour.write_sds_to_csv_file write_sds_to_csv_file(sds, path) ...

colour.models

Object Signature Author
colour.XYZ_to_sRGB sRGB_to_XYZ(RGB, illuminant=CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65'], chromatic_adaptation_transform='CAT02', apply_cctf_decoding=True) @KelSolaar
Object Name Author
colour.RGB_to_ICTCP RGB_to_ICtCp @KelSolaar
colour.ICTCP_to_RGB ICtCp_to_RGB ...
colour.RGB_to_IGPGTG RGB_to_IgPgTg ...
colour.IGPGTG_to_RGB IgPgTg_to_RGB ...

colour.plotting

Object Signature Author
colour.plotting.plot_constant_hue_loci plot_constant_hue_loci(data, model, scatter_kwargs=None, convert_kwargs=None, **kwargs) @KelSolaar
colour.plotting.plot_RGB_colourspaces_gamuts plot_RGB_colourspaces_gamuts(colourspaces, reference_colourspace='CIE xyY', segments=8, show_grid=True, grid_segments=10, show_spectral_locus=False, spectral_locus_colour=None, cmfs='CIE 1931 2 Degree Standard Observer', chromatically_adapt=False, convert_kwargs=None, **kwargs) ...
colour.plotting.plot_RGB_scatter plot_RGB_scatter(RGB, colourspace, reference_colourspace='CIE xyY', colourspaces=None, segments=8, show_grid=True, grid_segments=10, show_spectral_locus=False, spectral_locus_colour=None, points_size=12, cmfs='CIE 1931 2 Degree Standard Observer', chromatically_adapt=False, convert_kwargs=None, **kwargs) ...

colour.utilities

Object Access Author
colour.utilities.lerp colour.algebra.lerp @KelSolaar
colour.utilities.linear_conversion colour.algebra.linear_conversion ...
colour.utilities.matrix_dot colour.algebra.matrix_dot ...
colour.utilities.normalise_maximum colour.algebra.normalise_maximum ...
colour.utilities.vector_dot colour.algebra.vector_dot ...

colour.volume

Object Signature Author
colour.volume.XYZ_outer_surface XYZ_outer_surface(cmfs=MSDS_CMFS['CIE 1931 2 Degree Standard Observer'].copy().align(SPECTRAL_SHAPE_OUTER_SURFACE_XYZ), illuminant=sd_ones(SPECTRAL_SHAPE_OUTER_SURFACE_XYZ), point_order='Bins', filter_jagged_points=False, **kwargs) @KelSolaar
colour.volume.generate_pulse_waves generate_pulse_waves(bins, pulse_order='Bins', filter_jagged_pulses=False) ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment