Canvas versus SVG animations (effects[filters] and

2019-04-10 21:06发布

问题:

I am developing an application that should run equally smoothly on a web browser (IE support completely optional) and on iPhones and have tested various libraries for days, including: jQuery SVG, CAKE (Canvas Animation Kit Experiment), Burst Engine, Processing.js and Raphael, and have yet to find the right one for this experiment.

The input is optional - whether an SVG or a PNG rendered from the vector, the only two requirements for the animation library are to be able to animate (rotate) the image, and gradually apply a blur filter or a "trails"-like effect.

Should I go for SVG or Canvas, performance- and the forementioned effectswise?

Previously the project was in Flash, but regarding the trends and lack of iPhone support, I decided to switch to a more progressive software.

回答1:

Here you can compare filter performance svg vs canvas yourself. Another example shows how to do an svg 3d lighting effect vs canvas 3d lighting effect

There are many nice demos over at chromeexperiments showing both canvas and svg. And there's svg-wow.org which does the same more or less.