Colour 0.4.7 - Alpha Milestone
Features
Dependencies
- Support for Python 3.14 was implemented. (#1379, @ KelSolaar)
- scipy has been made optional.
- imageio has been made optional.
- typing-extensions requirement has been dropped.
The following scientific packages minimum versions are required:
- numpy >= 2.0.0
- scipy >= 1.13.0
- matplotlib >= 3.9
- networkx >= 3.3
- pandas >= 2.2
Documentation
- Each documented object has been verified and processed with a LLM to improve consistency and correct typos and mistakes. (#1352, #1357, @KelSolaar, Claude Code)
colour.adaptation
- Implement support for Li (2025) chromatic adaptation transform with
colour.chromatic_adaptation_Li2025definition. (#1349, #1356, @UltraMo114, @KelSolaar, Claude Code)
colour.appearance
- Implement support for sCAM colour appearance model with
colour.XYZ_to_sCAMandcolour.sCAM_to_XYZdefinitions. (#1349, #1356, @UltraMo114, @KelSolaar, Claude Code)
colour.io
- The
colour.LUT3D.invertmethod 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_indexandcolour.difference.XYZ_to_metamerism_indexdefinitions. (#1374, @lassefschmidt)
colour.models
-
Implement support for sUCS colour space model with
colour.XYZ_to_sUCS,colour.sUCS_to_XYZ,colour.models.sUCS_Iab_to_sUCS_IChandcolour.models.sUCS_ICh_to_sUCS_Iabdefinitions. (#1349, #1356, @UltraMo114, @KelSolaar, Claude Code) -
Implement Color Interop Forum recommendation for ColorSpace Encodings for Texture Assets and CG Rendering. (#1316, @KelSolaar)
The following RGB colourspaces were added:
colour.models.RGB_COLOURSPACE_LIN_REC709_SCENEcolour.models.RGB_COLOURSPACE_LIN_P3D65_SCENEcolour.models.RGB_COLOURSPACE_LIN_REC2020_SCENEcolour.models.RGB_COLOURSPACE_LIN_ADOBERGB_SCENEcolour.models.RGB_COLOURSPACE_LIN_CIEXYZD65_SCENEcolour.models.RGB_COLOURSPACE_SRGB_REC709_SCENEcolour.models.RGB_COLOURSPACE_G22_REC709_SCENEcolour.models.RGB_COLOURSPACE_G18_REC709_SCENEcolour.models.RGB_COLOURSPACE_SRGB_AP1_SCENEcolour.models.RGB_COLOURSPACE_G22_AP1_SCENEcolour.models.RGB_COLOURSPACE_SRGB_P3D65_SCENEcolour.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_2attribute. (#1323, @nick-shaw) -
Implement support for Fujifilm F-Gamut C RGB colourspace with
colour.models.RGB_COLOURSPACE_F_GAMUT_Cattribute. (#1317, @KelSolaar) -
Implement support for Xiaomi Mi-Log Profile with
colour.models.log_encoding_MiLogandcolour.models.log_decoding_MiLogdefinitions. (#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_tmmthat 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_lawcolour.phenomena.polarised_light_magnitude_elementscolour.phenomena.polarised_light_reflection_amplitudecolour.phenomena.polarised_light_reflection_coefficientcolour.phenomena.polarised_light_transmission_amplitudecolour.phenomena.polarised_light_transmission_coefficientcolour.phenomena.TransferMatrixResultcolour.phenomena.matrix_transfer_tmmcolour.phenomena.light_water_molar_refraction_Schiebener1990colour.phenomena.light_water_refractive_index_Schiebener1990colour.phenomena.thin_film_tmmcolour.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_filmcolour.plotting.plot_multi_layer_thin_filmcolour.plotting.plot_thin_film_comparisoncolour.plotting.plot_thin_film_spectrumcolour.plotting.plot_thin_film_iridescencecolour.plotting.plot_thin_film_reflectance_mapcolour.plotting.plot_multi_layer_stack
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_indexdefinition now also supportscolour.MultiSpectralDistributionsas 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
- scipy has been made optional to reduce import times. (#1375, #1376, @KelSolaar)
colour.algebra
- Optimise
colour.algebra.table_interpolation_trilinearandcolour.algebra.table_interpolation_tetrahedraldefinitions for 1.3x performance improvement. (b8e1583, @KelSolaar, Claude Code)
colour.temperature
- Vectorise
colour.temperature.uv_to_CCT_Robertson1968andcolour.temperature.CCT_to_uv_Robertson1968definitions for 30x and 90x performance improvement. (#1367, @KelSolaar, Claude Code)
Fixes
colour.utilities
- Ensure that
colour.utilities.tsplitdefinition returns a contiguous copy of the input array. (9ba813d, @KelSolaar)
Changes
colour.algebra
- The
colour.algebra.sdiv_modecontext manager andcolour.algebra.sdivdefinition 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.EPSILONwith a warning.
colour.colorimetry
- The
colour.SpectralDistribution.interpolatedefinition 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.interpolatecolour.SpectralDistribution.aligncolour.MultiSpectralDistributions.interpolatecolour.MultiSpectralDistributions.aligncolour.colorimetry.reshape_sdcolour.colorimetry.reshape_msds
- Numerical differences are expected if any of the following definitions were used with fractional wavelengths:
colour.models
| Object | Name | Author |
|---|---|---|
colour.IPT_hue_angle
| colour.models.IPT_hue_angle
| @KelSolaar |