Open ccameron-chromium opened 1 month ago
Thanks for starting this.
- Projecting in Lab to the Rec2020 gamut boundary along constant L
Why Lab and not Oklab, given the hue curvature of Lab (especially in blues, but also in orange to a lesser extent).
I agree that mapping to a smoothed gamut boundary may well be better.
- Projecting in Rec2020 YUV along constant Y
That is video luma, right? Where Y is computed without bothering to undo gamma-encoding first?
Thanks for starting this.
- Projecting in Lab to the Rec2020 gamut boundary along constant L
Why Lab and not Oklab, given the hue curvature of Lab (especially in blues, but also in orange to a lesser extent).
Sorry, that was a typo. I fixed up the original comment.
I agree that mapping to a smoothed gamut boundary may well be better.
- Projecting in Rec2020 YUV along constant Y
That is video luma, right? Where Y is computed without bothering to undo gamma-encoding first?
In the experiments that I did (which was not very exhaustive), I was doing this in linear space, but that was just because it was easier to plug into the pipeline at that stage.
Another option was to find the nearest point in the L2 sense in YUV space (either linear or gamma encoded). I haven't investigated that thoroughly.
Sorry, that was a typo. I fixed up the original comment.
Ah okay, makes sense.
I was doing this in linear space
That makes the calculated lightness accurate, so good. It doesn't make the UV plane perceptually uniform, of course.
There is some concave nastiness around the blue corner of the gamut that it would be nice to avoid.
This is clearly seen in CSS Color 4, Figure 2.
Separating the action item "ccameron: review gamut mapping algorithms" from here into a new issue. Tagging in @foolip @LeaVerou @svgeesus for the more limited discussion here (please feel free to include anyone else).
From the linked resolution in the issue, these algorithms are not to be applied to the various RGB spaces. I'd like to scope my comments to just "gamut mapping to apply to oklab/oklch" spaces, since I feel a bit differently about XYZ and Lab spaces (I would want XYZ and Lab to follow RGB, because they are the canonical profile connection spaces used in ICC based color matching, and don't want to mix this discussion with those issues).
The properties that I'd like for the algorithm to apply to just-oklab/oklch are much looser. An iterative algorithm with quadratic convergence is quite fine.
There were lots of algorithms listed in issue 9449, so I'd like to collect a reduced list of candidates here to discuss.
To provide an extremely short list: