A wonderfully warm winter day. Everything was perfect. Lofty visions of CSS3 animations dazzled my eyes. Nay, what's this? A browser from years ago appears. What's that you say? It doesn't support keyframes? Ghast. Make an animated gif! Oh, wait, we need transparency? Make an animated png!
This is the final outcome (sans history) of half a day spent to ensure experience parity on a super old (Opera 9.8) browser that we absolutely have to support.
It took hours, and it wasn't probably worth it, but I learned so much, and in the end it works pretty well.
The original animation (part of a larger web-app) is in spin.html
, but it all comes together in apng.sh
:
- simple python webserver
- point phantomjs at the page with the animation
- render out about 6 frames as pngs
- use imagemagick to convert the pngs to have transparent backgrounds
- package them up with apngasm into an apng
- open up a sample page (for quick debug/tweak cycles)
Oh, and as luck would have it, the latest Chrome doesn't have apng support, so you'll have to view it in Firefox or install the APNG plugin. Oh, and Github doesn't allow animated PNGs, so you'll have to click on the image.
It's still a little choppy, but it'll get the job done.