PR: Implement support sUCS colourspace and sCAM colour appearance model. #1349
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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