Reputation: 14327
I created an animated output.gif
from a screen capture that ends up being 89MB uncompressed. Half of the GIF is static but it would be best keeping it together rather than an image + a GIF containing the moving part.
Using Imagemagick and the following command I manage to reduce its size down to 18.1MB:
convert output.gif -coalesce -fuzz 3% +dither -layers Optimize compressed.gif
Increasing the percent produces much smaller size results but the quality is compromised.
Is there an option you suggest using for yielding a much better file size reduction without compromising on quality given that this GIF contains a large static non animated area?
UPDATE I'm using Ubuntu for this and here is my full workflow:
ffmpeg -i input.avi output.mp4
to convert to mp4.mkdir frames
.ffmpeg -i output.mp4 -r 25 'frames/frame-%04d.png'
.cd frames
.convert -delay 4 -loop 0 *.png output.gif
.convert output.gif -coalesce -fuzz 3% +dither -layers Optimize compressed.gif
Upvotes: 3
Views: 4778
Reputation: 8994
The best way to reduce the size of the GIF is to put as many frames as possible in "combine" mode. These frames only contain what has changed from the previous frame and this can be quite small, but this may require that all the frames be encoded with the very same colormap, and that identical parts are truly identical (no fuzziness, no random encoding artifacts). Gimp can do that but other utilities specialized in GIF processing can also do that (Gifsicle perhaps)?
Also, the animated GIF of a screen capture doesn't need to be 25fps, 10fps is more than enough.
Upvotes: 3