W3C home > Mailing lists > Public > www-svg@w3.org > October 2010

Re: painting-render-02-b.svg

From: Dirk Schulze <vbs85@gmx.de>
Date: Sun, 24 Oct 2010 18:30:58 +0200
Cc: www-svg@w3.org
Message-Id: <8F8162C6-4F0F-4711-9B56-208ADD32394E@gmx.de>
To: Chris Lilley <chris@w3.org>
Thanks for the reply:

> DS> I was looking at painting-render-02-b.html recently and I am a bit confused.
> DS> The tests should test the correct handling of
> DS> color-interpolation. Different rects have different properties of
> DS> color-interpolation: auto, sRGB, linearRGB and inherit.
> DS> But my understanding was that color-interpolation (or
> DS> transforming sRGB colors to linearRGB colors and back) just
> DS> influence the channels red, green and blue.
> Yes. On both the source and the background.
> DS> The rects on the test, with the different color-interpolations,
> DS> are filled with the color 'white'. According to the algorithm on
> DS> [1], the color spaces linearRGB and sRGB provide the same color
> DS> values. Both results are 255,255,255, independent if you transform
> DS> sRGB to linearRGB or back. So why should we see a difference between the rects?
> See 14.2 Simple alpha compositing
> http://www.w3.org/TR/SVG/masking.html#SimpleAlphaBlending
> the white, semiopaque rects are being composited onto rectangles filled with either  #7F7F7F or #BBBBBB and the result will differ depending on the color-interpolation value.
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-interpolation at 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 the link you posted.
Now we want to draw a shape onto this canvas in the color space linearRGB 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.

Received on Sunday, 24 October 2010 16:31:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:23 UTC