1

I am new to Javascript and recently I met a requirement to convert svg animation to gif. The animation was done by Snap.svg. I came up with an idea that if I could get the intermediate path of the animation(assume I just used path morphing like this), then I may be able to render each svg as a frame and finally form a gif. But I really got stuck with how to get intermediate svg. Is it possible for js to do such job? Or can someone help with other way to convert svg animation to gif?

Community
  • 1
  • 1
Jermmy
  • 113
  • 1
  • 8
  • You can use the SVG DOM to get the path at any point in time. – Robert Longson Dec 17 '16 at 17:16
  • Well, just as you said, I use setInterval() to get the svg "frame". It seems easy except for newer. – Jermmy Dec 18 '16 at 02:14
  • setInterval is a timing mechanism, I don't see what that has to do with getting data. – Robert Longson Dec 18 '16 at 09:26
  • from my experience no browser lets you access animated path data... chrome has no animatedPatSegList anymore, the polyfills for the new API getPathData only return the initial d value, and getPointAtLength on returns points on the unanimated Path. in Firefox animatedPathSegList only returns the ununimated pathSegList. i haven't got around testing how getPointAtLength behaves FF... – Holger Will Dec 18 '16 at 11:31

0 Answers0