github colour-science/colour v0.4.7
Colour 0.4.7

13 hours ago

Colour 0.4.7 - Alpha Milestone

Features

Dependencies

The following scientific packages minimum versions are required:

Documentation

colour.adaptation

colour.appearance

colour.io

  • The colour.LUT3D.invert method has been improved and yields smoother results via Shepard interpolation and iterative adaptive smoothing. (54637c4, @KelSolaar, Claude Code)

colour.difference

  • Implement support for Metamerism Index computation with colour.difference.Lab_to_metamerism_index and colour.difference.XYZ_to_metamerism_index definitions. (#1374, @lassefschmidt)

colour.models

The following RGB colourspaces were added:

  • colour.models.RGB_COLOURSPACE_LIN_REC709_SCENE
  • colour.models.RGB_COLOURSPACE_LIN_P3D65_SCENE
  • colour.models.RGB_COLOURSPACE_LIN_REC2020_SCENE
  • colour.models.RGB_COLOURSPACE_LIN_ADOBERGB_SCENE
  • colour.models.RGB_COLOURSPACE_LIN_CIEXYZD65_SCENE
  • colour.models.RGB_COLOURSPACE_SRGB_REC709_SCENE
  • colour.models.RGB_COLOURSPACE_G22_REC709_SCENE
  • colour.models.RGB_COLOURSPACE_G18_REC709_SCENE
  • colour.models.RGB_COLOURSPACE_SRGB_AP1_SCENE
  • colour.models.RGB_COLOURSPACE_G22_AP1_SCENE
  • colour.models.RGB_COLOURSPACE_SRGB_P3D65_SCENE
  • colour.models.RGB_COLOURSPACE_G22_ADOBERGB_SCENE

The following aliases were added:

  • lin_ap1_scene

  • lin_ap0_scene

  • lin_rec709_scene

  • lin_p3d65_scene

  • lin_rec2020_scene

  • lin_adobergb_scene

  • lin_ciexyzd65_scene

  • srgb_rec709_scene

  • g22_rec709_scene

  • g18_rec709_scene

  • srgb_ap1_scene

  • g22_ap1_scene

  • srgb_p3d65_scene

  • g22_adobergb_scene

  • Implement support for Filmlight E-Gamut 2 RGB colourspace with colour.models.RGB_COLOURSPACE_FILMLIGHT_E_GAMUT_2 attribute. (#1323, @nick-shaw)

  • Implement support for Fujifilm F-Gamut C RGB colourspace with colour.models.RGB_COLOURSPACE_F_GAMUT_C attribute. (#1317, @KelSolaar)

  • Implement support for Xiaomi Mi-Log Profile with colour.models.log_encoding_MiLog and colour.models.log_decoding_MiLog definitions. (#1359, @KelSolaar, Claude Code)

  • Implement Schlömer (2019) improved OSA-UCS to CIE XYZ conversion: This reduced failure cases significantly and brought x28.5 increased performance. (#1372, @KelSolaar, Claude Code)

colour.phenomena

  • Implement support for the Transfer Matrix Method: The main definition is colour.phenomena.matrix_transfer_tmm that computes transfer matrices for multilayer thin film structures with full vectorisation across wavelength, angle and thickness. (#1366, @KelSolaar, Claude Code)

The colour.phenomena.thin_film_tmm and colour.phenomena.multilayer_tmm definitions compute thin film and multilayer reflectance / transmittance respectively.

  • colour.phenomena.snell_law
  • colour.phenomena.polarised_light_magnitude_elements
  • colour.phenomena.polarised_light_reflection_amplitude
  • colour.phenomena.polarised_light_reflection_coefficient
  • colour.phenomena.polarised_light_transmission_amplitude
  • colour.phenomena.polarised_light_transmission_coefficient
  • colour.phenomena.TransferMatrixResult
  • colour.phenomena.matrix_transfer_tmm
  • colour.phenomena.light_water_molar_refraction_Schiebener1990
  • colour.phenomena.light_water_refractive_index_Schiebener1990
  • colour.phenomena.thin_film_tmm
  • colour.phenomena.multilayer_tmm

New plotting definitions were added, most notable ones being colour.plotting.plot_thin_film_iridescence, colour.plotting.plot_thin_film_reflectance_map and colour.plotting.plot_multi_layer_stack.

  • colour.plotting.plot_single_layer_thin_film
  • colour.plotting.plot_multi_layer_thin_film
  • colour.plotting.plot_thin_film_comparison
  • colour.plotting.plot_thin_film_spectrum
  • colour.plotting.plot_thin_film_iridescence
  • colour.plotting.plot_thin_film_reflectance_map
  • colour.plotting.plot_multi_layer_stack
image image

colour.quality

  • Implement support for Spectral radiance factors of test-colour sample #15 of the Japanese skin complexion, 5nm wavelength steps. (#1337, @cmuellner, @KelSolaar)
  • The colour.spectral_similarity_index definition now also supports colour.MultiSpectralDistributions as parameters. (#1373, #1370, @KelSolaar)

colour.utilities

Introduce a metadata system for documenting expected input/output value ranges in function signatures using Annotated type hints. Functions now declare scale information (e.g., [0, 1], [0, 100], [0, 360]) directly in their type annotations. (#1371, @KelSolaar)

Type Aliases for Common Scales

def XYZ_to_Lab(XYZ: Domain1) -> Range100:  # Domain [0, 1], Range [0, 100]
    ...

def Lab_to_LCHab(Lab: Domain100_100_360) -> Range100_100_360:  # Tuple scales
    ...

Metadata Extraction

from colour.utilities import get_domain_range_scale_metadata

metadata = get_domain_range_scale_metadata(XYZ_to_Lab)
# {'domain': {'XYZ': 1}, 'range': 100}

Automatic Scaling in Automatic Colour Conversion Graph

Lab = convert(XYZ, "CIE XYZ", "CIE Lab", to_reference_scale=True)  # Returns Lab in [0, 100]
XYZ = convert(Lab_native, "CIE Lab", "CIE XYZ", from_reference_scale=True)  # Accepts Lab in [0, 100]

Performance

Import Time

colour.algebra

  • Optimise colour.algebra.table_interpolation_trilinear and colour.algebra.table_interpolation_tetrahedral definitions for 1.3x performance improvement. (b8e1583, @KelSolaar, Claude Code)

colour.temperature

  • Vectorise colour.temperature.uv_to_CCT_Robertson1968 and colour.temperature.CCT_to_uv_Robertson1968 definitions for 30x and 90x performance improvement. (#1367, @KelSolaar, Claude Code)

Fixes

colour.utilities

  • Ensure that colour.utilities.tsplit definition returns a contiguous copy of the input array. (9ba813d, @KelSolaar)

Changes

colour.algebra

  • The colour.algebra.sdiv_mode context manager and colour.algebra.sdiv definition and other related objects now support two new modes:
    • Replace With Epsilon: Zero-division is avoided by replacing zero denominators with the machine epsilon value from :attr:colour.constants.EPSILON.
    • Warning Replace With Epsilon: Zero-division is avoided by replacing zero denominators with the machine epsilon value from :attr:colour.constants.EPSILON with a warning.

colour.colorimetry

  • The colour.SpectralDistribution.interpolate definition has been updated to handle fractional wavelengths better. (#1328, @KelSolaar)
    • Numerical differences are expected if any of the following definitions were used with fractional wavelengths:
      • colour.SpectralDistribution.interpolate
      • colour.SpectralDistribution.align
      • colour.MultiSpectralDistributions.interpolate
      • colour.MultiSpectralDistributions.align
      • colour.colorimetry.reshape_sd
      • colour.colorimetry.reshape_msds

colour.models

Object Name Author
colour.IPT_hue_angle colour.models.IPT_hue_angle @KelSolaar

Don't miss a new colour release

NewReleases is sending notifications on new releases.