W3C home > Mailing lists > Public > www-style@w3.org > November 2010

Re: [css3-images] Proposed Gradients changes

From: Chris Lilley <chris@w3.org>
Date: Tue, 23 Nov 2010 20:54:06 +0100
Message-ID: <78554784.20101123205406@w3.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Anne van Kesteren <annevk@opera.com>, Brad Kemper <brad.kemper@gmail.com>, www-style list <www-style@w3.org>
On Tuesday, November 23, 2010, 8:06:03 PM, Tab wrote:

TAJ> On Tue, Nov 23, 2010 at 8:08 AM, Anne van Kesteren <annevk@opera.com> wrote:
>> On Tue, 23 Nov 2010 16:58:06 +0100, Anne van Kesteren <annevk@opera.com>
>> wrote:
>>> Sorry, I meant whether colors are premultiplied or not. (For some reason I
>>> thought it was about interpolation.) It's not a syntax issue, but a model
>>> issue. And I would very much like the model to be shared with SVG/<canvas>
>>> so we do not need multiple codepaths.

>> Apparently we already went through the trouble to make this work and are
>> happy with it. Sorry about that!

TAJ> I'm explicitly matching the behavior of Transitions, based on feedback
TAJ> from Simon.  This also matches SVG by default, because SVG doesn't
TAJ> composite alpha with their colors - they track and transition color
TAJ> and opacity independently, so they don't have to worry about the issue

That is partially true. SVG has to worry about it when people start using rgba or hsla on SVG gradient stops, or the value 'transparent' (which in CSS3 color means 'transparent black') on SVG gradient stops, or apply a CSS gradient and an SVG gradient on different, overlapping, elements.

TAJ> (going from yellow to transparent in premultiplied colors is basically
TAJ> equivalent to going from yellow;opacity:1 to yellow;opacity:0 in SVG,
TAJ> modulo possibly some precision loss in the CSS colors).

Yes. The precision loss is a real concern there; at opacity 0.5 (1/2) you have gone from 8 bits per component to 7; at opacity (1/16) you are down to 4 bits per component (only 16 distinct shades of red, green and blue). This causes hue shifts due to quantisation error.

TAJ> It looks like <canvas> is specifying non-premultiplied for its
TAJ> gradients, though.  Hm.  I suspect we could change this if we got some
TAJ> implementor agreement.  Right now it's the odd-man-out on the
TAJ> platform, and that's unfortunate.


 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups
Received on Tuesday, 23 November 2010 19:54:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:41 UTC