Skip to content

Conversation

@lassefschmidt
Copy link

@lassefschmidt lassefschmidt commented Oct 24, 2025

Summary

As discussed with @KelSolaar , I wanted to add support for Metamerism calculation.

While the relevant delta_E equations are all available, there was so far not an option to get access to the intermediate delta Lab or delta LCH terms, which some metamerism formulas need. I added this support using a return_deltas boolean flag.

The implemented metamerism index allows to compute metamerism using CIE 1976, CIE 1994, CIE 2000, CMC, and DIN99. We can also either compute the metamerism using the intermediate deltas of the delta E computation or directly the delta E itself.

Everything should be properly documented, I added docstrings and unit tests where necessary !

Preflight

Code Style and Quality

  • Unit tests have been implemented and passed.
  • Pyright static checking has been run and passed.
  • Pre-commit hooks have been run and passed.
  • New transformations have been added to the Automatic Colour Conversion Graph.
  • New transformations have been exported to the relevant namespaces, e.g. colour, colour.models.

3 tests failed, all related to image.io -- which was not touched / modified in this PR at all. See below output

=========================== short test summary info ===========================
FAILED colour/io/image.py::colour.io.image.read_image_Imageio
FAILED colour/io/tests/test_image.py::TestWriteImageImageio::test_write_image_Imageio_exr
FAILED colour/io/tests/test_image.py::TestReadImageImageio::test_read_image_Imageio
========== 3 failed, 3632 passed, 17 skipped, 208 warnings in 45.99s ==========

Documentation

  • New features are documented along with examples if relevant.
  • The documentation is Sphinx and numpydoc compliant.

Best,
Lasse

The import was removed after a false-positive F401 lint warning.
`np` is required for doctests executed via pytest --doctest-modules.
Added `# noqa: F401` to clarify intentional usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant