Re: [css4-images] non-premultiplied gradients and in the wild

I agree.
Premultiplied gradients are big mistake.

On Wed, Aug 29, 2012 at 7:07 AM, Alan Gresley <alan@css-class.com> wrote:

> On 9/08/2012 6:53 PM, Alan Gresley wrote:
>
>> On 7/08/2012 10:02 AM, Tab Atkins Jr. wrote:
>>
>>> Heya, I've finished up the first draft of Image Values level 4
>>> <http://dev.w3.org/csswg/css4-**images<http://dev.w3.org/csswg/css4-images>>,
>>> incorporating several of the
>>> features we punted from level 3 and a few new ones.  I'd greatly
>>> appreciate feedback on the changes so we can potentially do a FPWD
>>> after the f2f.
>>>
>>
> Am I going to get a response to the message?
>
> With every single reason why non-premultiplied gradients were rejected, I
> was able to show how it could be done with slightly different syntax.
>
>
> To have a gradient from 'transparent' to 'yellow' and have the midway
> point as ##FFFF79 (light yellow), all an author needs to do is use
> transparent-yellow to yellow.
>
>   linear-gradient(rgba(255,255,**0,0), rgba(255,255,0,1))
>
>
> To use 'transparent' as a midway point between two colors, all an author
> needs to do is repeat the transparent part two times at 50% (i.e. red to
> transparent-red against transparent-blue to blue)
>
>   linear-gradient(rgba(255,0,0,**1), rgba(255,0,0,0) 50%, rgba(0,0,255,0)
> 50%, rgba(0,0,255,1))
>

Correct.
Special casing 'transparent' so it does this under the hood would be much
better. I'm unsure if we can change it at this point, although there are
probably few people that rely on this...

Maybe if we add support for interpolation in Lab or the linear colorspace,
we can ask to skip premultiplication.



>
>
> Now after a year, Firefox 15 and Chrome 21 shows the following demo the
> same.
>
> http://css-class.com/test/**temp/color-transparent.htm<http://css-class.com/test/temp/color-transparent.htm>
>
> This behavior is now going onto well over a year in the wild.
>
>
>  Does this version attend to address interpolation of gradients in
>> non-premultiplied space? You're reply to me last year.
>>
>> http://lists.w3.org/Archives/**Public/www-style/2011Aug/0109.**html<http://lists.w3.org/Archives/Public/www-style/2011Aug/0109.html>
>>
>>    | I don't believe we should select the color-space based
>>    | on the syntax of the colors used, because a color should
>>    | be independent of the syntax used for it.  Instead, I
>>    | believe this should be done either by defining SVG's
>>    | color-interpolation property to apply more widely to
>>    | all CSS values, or by giving gradients a specialized
>>    | switch to control the color-space they transition in.
>>    | I'll address this in a later level of Image Values.
>>
>>
>> Also in example 29 is found the text.
>>
>>    | In premultiplied space, transitions to or from
>>    | "transparent" always look nice:
>>
>> Can this be changed to something like this.
>>
>>    # In premultiplied space, transitions to or from
>>    # "transparent" look more natural when composite
>>    # near white backgrounds.
>>
>>
>>
>>
>
> --
> Alan Gresley
> http://css-3d.org/
> http://css-class.com/
>
>

Received on Wednesday, 29 August 2012 17:48:01 UTC