W3C home > Mailing lists > Public > www-svg@w3.org > February 2011

Re: painting-render-02-b.svg

From: Osmo Jaakkola <orbik@iki.fi>
Date: Wed, 09 Feb 2011 18:51:16 +0200
To: www-svg@w3.org
Message-ID: <op.vqnafqjlo6uym8@rbi.kyla.fi>
> All white rects have the same transparency level and are drawn onto a 
> solid black background. Just the rects on the first row are filled with 
> either #7F7F7F or #BBBBBB but don't test color-interpolationat all.
>> Yes. On both the source and the background.
> Ok, this is maybe the point where I have the understanding problems. I 
> still read the Spec this way: At first we have the canvas, where 
> everything is drawn on by the compositing algorithm mentioned on thelink  
> you posted.
> Now we want to draw a shape onto this canvas in the color spacelinearRGB  
> while the canvas itself is in sRGB.
>For a better understanding I'll take a surface/buffer where I draw the 
> shape onto. This surface with the shape gets transformed to linearRGB. 
> Now I draw this surface on the canvas by compositing it with the 
> algorithm of the spec respecting the transparence that is set by the 
> property 'fill-opacity'.
>For the example on the test suite, it means we would draw the rect onto 
> the canvas with the fill color white. Now we transform this surface to 
> linearRGB. But because we filled the shape with white: rgb(255,255,255) 
> the linearRGB transformation doesn't influence the surface. According to 
> the sRGB to linearRGB algorithm of the Spec, the resulting color values 
> are rgb(255,255,255).
> At the end we draw the surface on the canvas with the 'fill-opcity:0.5' 
> by compositing it to the canvas.
>The background is black, so we see the same gray independent if we draw 
> the rect with linearRGB or sRGB.
> We might of course see a difference if we'd use another fill color than 
> white. But I don't get it why we should see a difference on this test.

Because the alpha blending is done in linear RGB, and needs to be  
converted back to the parent's (canvas') color space.

Background = sRGB(0, 0, 0) => linRGB(0, 0, 0)
Foreground = sRGB(1.0, 1.0, 1.0) => linRGB(1.0, 1.0, 1.0)
Opacity = 0.5
Result = linRGB(0.5, 0.5, 0.5) => sRGB(0.735, 0.735, 0.735)
Received on Wednesday, 9 February 2011 19:34:37 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT