Re: [csswg-drafts] [css-color-4] Should gamut mapping occur before or after interpolation? (#5928)

If done before interpolation, there is no guarantee that the interpolated results are still within the display gamut - especially when interpolating in a [cylindrical polar color](https://drafts.csswg.org/css-color-4/#cylindrical-polar-color) representation, because of the irregular shape of the gamut volume in any perceptually-uniform colorspace. 

Thus, _gamut mapping after interpolation will **always** be needed_. This is the same as any other operation which calculates a color.

Also, linear interpolation where one or both of the colors to be interpolated is outside the display gamut, can easily produce in-gamut colors on part of the interpolation line. For example, interpolating in a [rectangular orthogonal color](https://drafts.csswg.org/css-color-4/#rectangular-orthogonal-color) representation, from some oog color  to the neutral axis.

The benefit of pre-interpolation gamut mapping in that case would be to avoid that portion of the interpolation line which is outside the gamut, mapping to the same or a similar color. The drawback is that _all_ the in-gamut colors would be different, if gamut mapping is performed before interpolation (because the start position is changed).

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5928#issuecomment-774054708 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 5 February 2021 14:09:20 UTC