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

RE: [css3-images] July F2F minutes comment regarding SVG and non-opaque colors

From: Brian Manthos <brianman@microsoft.com>
Date: Mon, 22 Aug 2011 17:24:52 +0000
To: Alan Gresley <alan@css-class.com>
CC: Tab Atkins Jr. <jackalmage@gmail.com>, Cameron McCormack <cam@mcc.id.au>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <9710FCC2E88860489239BE0308AC5D17133B2A@TK5EX14MBXC266.redmond.corp.microsoft.com>
Alan, your definition of pre-multiplied doesn't match our working definition -- at least as I understand it.

More specifically...

>           non-premultiplied           composite on black
> 
> 100%     rgba(255,255,255,1.0)    =  rgb(255,255,255)
> 50%      rgba(127,127,127,0.5)    =  rgb(64,64,64)
> 75%      rgba(64,64,64,0.25)      =  rgb(16,16,16)
> 87.5%    rgba(32,32,32,0.125)     =  rgb(4,4,4)
> 93.75%   rgba(16,16,16,0.0625)    =  rgb(1,1,1)

The 2nd column is valid by our working definition of non-pre-multiplied, for the last three rows the first column and the second column don't align -- at least the way I would label them.  Also, the pattern from the 1st two rows and the last three rows is inconsistent -- the alpha is dropping but the percentage is rising.

Nonetheless, rounding aside (2nd row), your characterization of composition on black (3rd column) aligns with what I would expect.

>           premultiplied               composite on black
> 
> 100%     rgba(255,255,255,1.0)    =  rgb(255,255,255)
> 50%      rgba(255,255,255,0.5)    =  rgb(127,127,127)
> 75%      rgba(255,255,255,0.25)   =  rgb(64,64,64)
> 87.5%    rgba(255,255,255,0.125)  =  rgb(32,32,32)
> 93.75%   rgba(255,255,255,0.0625) =  rgb(16,16,16)

[Same issue with alpha dropping but percentage rising.]
[Same issue with rounding in second row; and now present in 3rd, 4th, and 5th rows.]

This doesn't match our working definition of premultiplied.  More specifically, all but the first row are invalid pre-multiplied representations because the R, G, and B channels must be at or below (255 *  A).

The bucketing is as follows...

Invalid
	prgba(255,255,255,0.5);
	...
	prgba(128,128,128,0.5);

Valid
	prgba(127.5,127.5,127.5,0.5);
	...
	prgba(0,0,0,0.5);



Now, if you'd like to suggest pushing back on our working definition of pre-multiplied you can do so -- but then we need a new term for the CSS (and SVG) specification(s), and I suspect the industry as a whole.

Perhaps "alpha-multiplied" vs. "non-alpha-multiplied".


I think David's characterization of the current working definition of pre-multiplied is a pretty good one:
# "pre" in this context really means
# "have already been" rather than "before",


Re-looking at your numbers above perhaps your using "pre-multiplied" to mean "not yet multiplied" and "post-multiplied" to mean "after doing the multiply".



If that's the case, then here's my interpretation of a gray example:

rgba(128,128,128,0.25)
= spec non-pre-multiplied
= Alan's pre-multiplied
= non-alpha-multiplied
= painted on black looks like rgb(32,32,32)

prgba(32,32,32,0.25)
= spec pre-multiplied
= Alan's post-multiplied (he said non-pre-multiplied in his table but I think he meant post-multiplied)
= alpha-multiplied
= painted on black looks like rgb(32,32,32)
Received on Monday, 22 August 2011 17:34:35 GMT

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