Re: [filter-effects] Animation between filter functions

On Aug 15, 2013, at 7:45 AM, Cameron McCormack <cam@mcc.id.au> wrote:

> Dirk Schulze wrote:
>> 1) One of the filter function lists consist of at least one SVG
>> filter reference (URL or<child>  selector)
> 
> Are there other properties that take lists of values that might or might
> not be interpolable?  We should have the same behaviour, if so.

Maybe fill and stroke are comparable. Both can have an URL and a fallback color. WebKit/Blink animate the fallback color independent of the URL. Firefox just animates the fallback color of no URL was specified.

> 
>> 2) At least one filter function pair is not of the same type.
> 
> Same question here.

CSS Transforms demands to multiply the transform functions all together and interpolate the resulting matrix.
This is not really comparable. Other properties might have a different list length (like stroke-dasharray), but no different types.

> 
>> To 1): Is it possible to remove this restriction and animate all
>> function pairs if they are of the same type even if we have a SVG
>> Filter reference? What happens with the filter reference? In theory
>> they could follow the animation model of enumerations that the CSS WG
>> agreed on in Lyon. (Every time the transition function crosses 0.5 on
>> output percentage, the value flips to either from- or to-reference
>> depending on the derivation of the transition function.)
> 
> Sounds reasonable to me.

WebKit/Blink do animate the other filter pairs if there is a URL, but does not switch the URLs depending on the animation function result or progress.

> 
>> To 2): Many filter functions (shothands) can be described by color
>> matrices. Is there a way to interpolate between color matrices? I
>> assume that it does not necessarily produce meaningful results, just
>> like interpolation between matrix items on CSS transforms. Does
>> anyone have experience on that?
> 
> I guess "meaningful" is open to interpretation.  It at least will let 
> you see some continuous change in the filtered output.  There's still a 
> good chance of it behaving unexpectedly, though.  Consider for example 
> interpolating from 'hue-rotate(60)' to 'grayscale(0)'.  That will behave 
> very differently from interpolating 'hue-rotate(0)', even though it has 
> the same colour matrix as 'grayscale(0)'.

Well, if you interpolate the items of the color matrix, you should actually not see a difference (hue-rotate(0deg) and grayscale(0) are identity color matrices).

> 
> I don't think we can come up with a useful canonical decomposition (or 
> maybe one at all?) like we do with transforms.

I didn't find a good one yet, but will investigate further. Even then, how would the computed style look like?

Greetings,
Dirk

Received on Thursday, 15 August 2013 07:15:42 UTC