Skip to content

PR: Implement support sUCS colourspace and sCAM colour appearance model. #1349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

UltraMo114
Copy link

This Pull Request introduces the Simple Uniform Colour Space (sUCS) and the Simple Colour Appearance Model (sCAM), as described in Li & Luo (2024).

This work directly addresses and implements the features requested in issues:

Closes #1335
Closes #1238
Key contributions of this PR:

sUCS Implementation (colour.models.sucs):
XYZ_to_sUCS: Transformation from CIE XYZ to sUCS.
sUCS_to_XYZ: Transformation from sUCS back to CIE XYZ.
Associated matrices (MATRIX_SUCS_XYZ_TO_LMS, etc.).
Comprehensive unit tests for transformations, n-dimensional support, domain/range scaling, and NaN handling.
Docstrings with examples and references.
sCAM Implementation (colour.appearance.scam):
XYZ_to_sCAM: Forward transformation from CIE XYZ to sCAM correlates (J, C, h, Q, M, H).
sCAM_to_XYZ: Inverse transformation from sCAM correlates back to CIE XYZ.
Includes chromatic adaptation using CAT16.
Defines InductionFactors_sCAM, VIEWING_CONDITIONS_sCAM, and CAM_Specification_sCAM.
Hue computation and composition logic specific to sCAM.
Comprehensive unit tests covering transformations, n-dimensional support, domain/range scaling, NaN handling, and exception raising for invalid inputs.
Docstrings with examples and references.
Author:
The sUCS and sCAM models, along with this initial Python implementation, were developed by Li, Molin (UltraMo114).
Compliance:
The code adheres to the Colour Science contributing guidelines.
All pre-commit hooks pass.
All local tests (pytest) pass.
Reference:
Li, M., & Luo, M. R. (2024). Simple color appearance model (sCAM) based on simple uniform color space (sUCS). Optics Express, 32(3), 3100-3122. doi:10.1364/OE.510196

… transformations (XYZ_to_sUCS, sUCS_to_XYZ) and associated tests. - Add sCAM colour appearance model (XYZ_to_sCAM, sCAM_to_XYZ) and associated tests.
@KelSolaar
Copy link
Member

Thanks a lot @UltraMo114!

I will take a look in coming days.

@KelSolaar KelSolaar changed the base branch from develop to feature/sucs-scam-staging June 7, 2025 21:49
Copy link
Member

@KelSolaar KelSolaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton @UltraMo114!

I will merge this directly in a staging branch.

@KelSolaar KelSolaar merged commit 57d9376 into colour-science:feature/sucs-scam-staging Jun 7, 2025
16 checks passed
@KelSolaar KelSolaar changed the title FEAT: Implement sUCS and sCAM models and tests - Add sUCS colourspace… PR: Implement support sUCS colourspace and sCAM colour appearance model. Jun 7, 2025
@KelSolaar KelSolaar added this to the v0.4.7 milestone Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Implement support for *Simple Colour Appearance Model*. [FEATURE]: Implement support for *sCAM* colour appearance model.
2 participants