W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: [css3-background] should specify color space for box-shadow blurring

From: Alan Gresley <alan@css-class.com>
Date: Sat, 01 Oct 2011 22:21:32 +1000
Message-ID: <4E8705CC.4000209@css-class.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Brian Manthos <brianman@microsoft.com>, "L. David Baron" <dbaron@dbaron.org>, "www-style@w3.org" <www-style@w3.org>
On 1/10/2011 9:55 PM, Alan Gresley wrote:
> On 1/10/2011 10:59 AM, Tab Atkins Jr. wrote:

>> Nope, that's still correct. In that note I'm talking about the
>> difference between premultiplied and non-premultiplied spaces.
>
> There is not premultiplied and non-premultiplied spaces.
>
> There is only premultiplied and non-premultiplied traversal (paths) of
> sRGB colorspace (with full opacity).

Correction. There is only non-premultiplied traversal (path) of sRGB 
colorspace. A premultiplied gradient does not transverse any colorspace 
since the color is always the same.

I will repeat this about alpha composting.

http://en.wikipedia.org/wiki/Alpha_compositing

   | If an alpha channel is used in an image,
   | it is common to also multiply the color
   | by the alpha value, to save on additional
   | multiplications during compositing. This
   | is usually referred to as premultiplied
   | alpha.

   (Note: to save on additional multiplications is what
    premultiplied implies so 'pre' means 'before')

   | Assuming that the pixel color is expressed
   | using straight (non-premultiplied) RGBA tuples,
   | a pixel value of (0.0, 0.5, 0.0, 0.5) implies
   | a pixel which has 50% of the maximum green
   | intensity and 50% opacity. If the color were
   | fully green, its RGBA would be (0, 1, 0, 0.5).


   | However, if this pixel uses premultiplied
   | alpha, all of the RGB values (0, 1, 0) are
   | multiplied by 0.5 and then the alpha is
   | appended to the end to yield (0, 0.5, 0, 0.5).
   | In this case, the 0.5 value for the G channel
   | actually indicates 100% green intensity
   | (with 50% opacity). For this reason, knowing
   | whether a file uses premultiplied or straight
   | alpha is essential to correctly process or
   | composite it.

Alan

-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/
Received on Saturday, 1 October 2011 12:22:02 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT