-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Gamut Mapping and HDR colors #630
Comments
The gamut mapping that Color.js currently employs is based on the current CSS spec, and it is currently SDR-centric with very specific rules about when lightness exceeds Oklab 100% which is based on SDR white. This essentially forces things to get clipped to white. Generally, I don't think this makes sense for an HDR gamut. In practical cases, it is probably not likely that many devices would utilize the full headroom that a given HDR space offers, so often you would need to specify an HDR limit, likely less than the gamut could handle. I realize that, at some point, we may want to have a more complicated approach to gamut mapping HDR spaces, but I would think in the short term, instead of assuming an SDR limit, we could just remove that limiter for HDR spaces, either that or you could clamp to the HDR limit, but you need to have a bounded space communicate it's max lightness somehow, either by having it specified in some common form or calculating it on the fly.
If we want to treat Rec2100-linear as limitless, that seems fine to me. I wouldn't normally check its gamut as it doesn't define a real HDR limit and is more used as a linear working environment for PQ and HLG. |
I was thinking about this again. Another approach could be to do what ACES does and just give Linear Rec. 2100 enormous headroom like ACES (65504). That way you could also still have a lower limit and a nearly unbounded upper that should accommodate pretty much any other space. It would also allow you to keep an appropriate lower limit. |
I thought about that as well but the CSS Color HDR Module Level 1 spec currently defines the Percent reference range as
So the color space would need to have a |
Yeah, I guess the alternative would be a way to define a lower, bound end and an upper, unbound reference end. I think right now it's all or none. |
Just using a reference range for upper and lower is probably the easiest though. |
From color-js/apps#11
I think the fix for
rec2100-linear
is to userefRange
for the coords instead ofrange
. This would make the space unbounded so no gamut mapping would occur.How should gamut mapping work for other color spaces like
rec2100-pq
,rec2100-hlg
,acescg
andacescc
that haverange
coordinates when the coordinates of a color are outside of the range of the color space.For example:
It seems a bit strange that color(rec2100-pq 1.01 1 1) is gamut mapped to
color(rec2100-pq 0.58069 0.58069 0.58069)
. I would have expected the result to be color(rec2100-pq 1 1 1) when gamut mapping to the same color space (for rec2100-pq) but maybe my intuition is wrong?The text was updated successfully, but these errors were encountered: