Re: [css-compositing] group invariance


Hi Rik,

--Original Message--:
>All,
>
>we've been discussing my proposal internally. One of my coworkers brought up an issue with group invariance in my proposal and I wanted to see if people believe that this is an issue.
>
>One of the principles of the Adobe imaging model is that adding a default group should not change the appearance of the artwork. (Changing group's parameters to isolate:true or knockout: true will change appearance)
>In SVG which uses the <g> operator for grouping, this is also the case.
>
>However, with my proposal, things will render differently. 

No, I believe these will both render the same and provide group-invariance.

The issue I think you are having is imagining Porter-Duff as a node in a binary
tree of objects. It isn't. It is a property of the object that takes effect
when the object is rendered, not as a second-pass as is the case with filters.

>For instance, this example:
>
><circle>
><circle alpha-compositing='dst-in'>
>will render differently from:
>
><circle>
>
><g>
>
>
><circle alpha-compositing='dst-in'>
>
>
></g>

No they render identically.

The <g> does not create a new backing store and so when the circle
is rasterized onto the existing background (containing a circle) the
Porter-Duff composition will happen between the pixels of the second
and first circles using the alpha channel of the backing store. The <g>
has no effect as it doesn't do anything.

>You can rewrite the second section as:
>
><circle>
>
><g alpha-compositing='src-over'> // src-over is the default
>
>
>
><circle alpha-compositing='dst-in'>
>
>
></g>
>
>This code will do a 'dst-in' of the circle with an empty buffer. This empty buffer is then composited over the first circle.

No again. There is no enable-background="new" that would create a backing store.

>My question is:
>a. Do people believe that group invariance is an important feature to have?

It's a nice to have and I don't believe the P-D operators violate that anyway.

>b. If so, do you want to see this fixed in the first spec or can we address this in a later version?

I think it's important to stop thinking about the filter model and P-D as being a post-processing
step after an object is rasterized. The P-D operator determines the functions applied during
rasterization and this was always the case (and reason it works better than filters).

>Making alpha-compositing group invariant is quite complex. The math is comparable to how 'enable-background' works.

Setting 'opacity' on the group will force a backing store to be generated, but there's
no way to represent that with just the 2 circles anyway (e.g. fill-opacity/stroke-opacity bleed
if you try to use those as an equivalent).

The complexity arises if you try to put a P-D operator on the group itself without
an enable-background set. That case was solved with the background removal
maths in the spec. so is not an issue technically. Group invariance is preserved
if you implement to the spec.

Personally I think it'd be easier to just drop P-D for groups without enable-background
set but that's just my opinion.

Cheers,
Alex

>Rik
>
>
>

Received on Tuesday, 22 November 2011 02:52:28 UTC