Re:The Edge of HTML5
by jacobolus on Saturday January 21, 2012 @03:51PM
(#3494559)
As specced, that’s actually incorrect then. The porter duff “over” operation is identical to what’s used in browsers for regular painting of semitransparent layers (or as another example, Photoshop’s “normal blend mode”). If the below pixel A is entirely opaque, and the above pixel B has opacity P, then the color of each pixel can be computed as (1 - P) * A + P * B. If however you apply a global alpha to the below image beforehand, you get something that isn’t a cross-fade at all, and in fact isn’t even fully opaque.
[edit: When I think about this a bit more, there is one time when cross-fade is useful: For cross-fading between two semitransparent images. In that case though, what’s wanted is not really a compositing operation at all, but rather a straight linear interpolation between the respective RGBA components of the two images.]
I don’t at all believe that people working on the color and graphics aspects of web specs are sufficiently critical. In general, those aspects have been quite under-specced, and browser implementations have been incomplete and buggy. Things are improving little by little, but to take one example, there is still no proper color management of CSS/HTML colors in any browser except Firefox, and I believe it’s still turned off by default there.
[edit: When I think about this a bit more, there is one time when cross-fade is useful: For cross-fading between two semitransparent images. In that case though, what’s wanted is not really a compositing operation at all, but rather a straight linear interpolation between the respective RGBA components of the two images.]
I don’t at all believe that people working on the color and graphics aspects of web specs are sufficiently critical. In general, those aspects have been quite under-specced, and browser implementations have been incomplete and buggy. Things are improving little by little, but to take one example, there is still no proper color management of CSS/HTML colors in any browser except Firefox, and I believe it’s still turned off by default there.