-
Notifications
You must be signed in to change notification settings - Fork 10
Implement absolute color conversions and chromatic adaptation #139
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e6cd13f to
bbdfdca
Compare
tomcur
commented
Feb 4, 2025
raphlinus
approved these changes
Feb 13, 2025
Contributor
raphlinus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks! I tried to find a nit just to prove I actually read it, but failed to do so.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 17, 2025
This is useful to test the current implementation of absolute conversions (added in #139), but the main motivation is to have tests in place as preparation for manual implementations of `ColorSpace::{to_linear_srgb_absolute, from_linear_srgb_absolute}` for the non-D65 color spaces.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 24, 2025
This builds on #139, which added absolute color conversions (conversions without chromatic adaptation). The default method implementations added there use the chromatically-adapting methods and undo adaptation through additional matrix multiplies. For efficiency, we can do the absolute conversions using matrices that do not include adaptation in the first place. This PR does that for ProPhoto RGB. More to follow.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 adds absolute color conversions and chromatic adaptation, and is, more or less, a prerequisite for #137.
Conversion methods are added to
ColorSpace,ColorSpaceTag, andDynamicColor, that convert between color spaces while keeping the same absolute color (i.e., if that color were to be reproduced, it would be the same physical color, but a perceptually different color under the intended reference white of the color space). These methods are suffixed_absolute. This also adds achromatically_adaptmethod for manual chromatic adaptation (useful for, e.g., "white balancing" pictures).The white points are represented as CIE
xychromaticities. Calculation of chromatic adaptation matrices isconstwhere possible.A follow-up to this would be to manually implement
ColorSpace::{to_linear_srgb_absolute, from_linear_srgb_absolute, convert}for the color spaces we provide. Those can in most cases just lift directly from their non-_absolutecounterparts, with the exceptions being XYZ-D50, ACEScg and ACES2065-1. Those methods will get somewhat simpler matrices, as the{D50, ACES}<->D65adaptation transforms can be dropped.