SVG 2 rendering model

Hi guys,

While reworking the rendering model section of SVG 2, I came across an
incompatibility between filter effects and the required method of
rendering compositing groups from the Compositing and Blending
specification.

In SVG versions < 2, the process for rendering a group is
1. Create a new buffer initialised to transparent black
2. Composite elements within the group into this buffer using src-over
and the normal blend mode (aka simple alpha blending)
3. Apply filter effects to the buffer
4. Composite buffer with the group backdrop using src-over and normal
blend mode

When following the Compositing and Blending specification, as it
currently stands, the method will be
1. Create a new buffer initialised with the initial backdrop*
2. Composite elements within the group into the buffer using the
compositing operator and blend mode specified
3. Apply filter effects to the buffer (buffer contains elements from
initial backdrop so these will be included in the filter effect)
4. Composite buffer with the group backdrop using the compositing
operator and blend mode specified - compensating for double contribution
of group backdrop

* The initial backdrop is dependent on the isolated property.
In the default case (isolated=false) the group backdrop == the initial
backdrop.
When isolated=true, the initial backdrop is transparent black.
The group backdrop contains everything that has been drawn up to but not
including the first element in the group.

So why do we have to do it the new way?
In SVG 1.1 we used src-over and normal, and this combination of operator
and blend mode is group invariant, i.e. A + (B + C) == A + B + C, where
A is the group backdrop and B and C are grouped.

But now we have lots of new compositing operators and blend modes and
some of them aren't group invariant - colour burn for example, or the
src-atop compositing operator.
So now we MUST do A + B + C when isolated==false

But this means we bring the group backdrop into the group and then when
we apply a filter effect to the group, the filter effect includes the
group backdrop.
To avoid bringing the group backdrop into the group, we can make the
group isolated, but this is not currently the default behaviour in the
Compositing and Blending specification.
So at the moment, the default behaviour in SVG 2 is different to the
default behaviour in other versions of SVG.

So, as far as I can see, the options are:
1. make isolated the default - but this isn't consistent with other
technologies - like PDF
2. state that for invariant groups, the contents of the groups are
composited together first - we'd have to list all the combinations that
are group invariant but at least it would be transparent to the author -
although they would likely be confused when a non invariant group
includes the backdrop in the filter effect.
3. not be backwards compatible - generally unpleasant

I'm leaning towards making isolated the default, but I'd like to hear if
anyone else has ideas for options, or other opinions.

I hope that was all clear =)
I can make an example if people feel it would help their understanding -
but I won't be able to find the time this week.

Cheers,
Nikos
The information contained in this email message and any attachments may be confidential and may also be the subject to legal professional privilege. If you are not the intended recipient, any use, interference with, disclosure or copying of this material is unauthorised and prohibited. If you have received this email in error, please immediately advise the sender by return email and delete the information from your system.

Received on Thursday, 2 August 2012 01:27:33 UTC