I know Lottie animations are far superior to GIFs in terms of size, control, and quality. I'm looking for a way to convert a single Lottie animated as I don't want to include extra javascript resources in a project. Is there a way to convert a Lottie animation to a GIF or another moving image?
You could use https://lottiefiles.com/lottie-to-gif to convert your Lottie animations to GIF.
-
This feature wasn't (publicly) available when I asked this question, however I believe this as of May 2020 is the best way to do this as a one-time operation. – bones225 May 16 '20 at 21:18
-
This works but its very limited in resolutions, and opaque background colors don't seem to work (on Firefox at least, or they didn't work with my particular animation) – Lucas P. Jul 28 '20 at 10:38
-
1I was unable to create a GIF with transparent background. :| Also, the GIF conversion is very slow! – user246392 Aug 31 '20 at 3:39
As mentioned here: https://github.com/airbnb/lottie-web/issues/1614 there is a javascript library for this. It's called puppeteer-lottie. They also provide a command line interface
I used it once and the output was not as good as the original lottie animation but ok. I just used the default settings.
-
2As a note, I had a lot more successful results when I generated PNGs (like the first line here) and then merged them with ffmpeg with a command like
ffmpeg -y -framerate 60 -i frame-%d.png -filter_complex "[0:v] fps=50,split [a][b];[a] palettegen [p];[b][p] paletteuse" out.gif
. This removes the transparency, but drops the gifski dependency and gets rid of glitchy graphics. – Ave Oct 22 '20 at 22:53