Re: [css3-images] We should use linear RGB color space when doing gradients (and transitions, and ...)

On Sat, Jan 14, 2012 at 8:55 AM, Witold Baryluk
<> wrote:
> On 01-13 23:27, Tab Atkins Jr. wrote:
>> Since everything currently uses sRGB, gradients should match that and
>> stay how they are.
> I disagree. As you said, everything is sRGB, but doing linear gradients
> in way they are currently done, are incorrect usage of sRGB. sRGB is
> only usefull for transfering pixels colors, not performing ANY
> operations on them other than displaying on devices using same color
> space. Any operation like resampling, rescaling, generating gradients,
> performing blending, performing any kind interpolation based on
> position, time, or other parameters must be done in linear space to
> produce correct sRGB result.
> This just means that CSS is not using sRGB, but mix of sRGB and RGB,
> often interchanging them without doing proper conversion.

I agree that it's wrong.  However, it's better for everything to be
wrong in a consistent way (which can be fixed later) than for things
to be inconsistent, with some things working correctly and others

SVG *already has* a way to fix this, via the 'color-interpolation'
property: <>.
 SVG gradients pay attention to it, and it defaults to sRGB.  At some
point we should pull it into general CSS so that it applies to CSS
gradients as well

I won't be making this change - CSS gradients should be consistent
with SVG gradients, CSS Transitions/Animations (and, I suspect, SVG
animations as well, though I haven't tested it), and other things.
SVG has a way to indicate that all of its things should use linearRGB
instead, and CSS should adopt that in the future, but I don't want to
add it to Image Values level 3.  It should be considered for either
Image Values 4 or Colors 4.

Please indicate whether or not this resolution is acceptable.


Received on Sunday, 15 January 2012 00:38:08 UTC