Table of Contents

Gif

About

gif is an image format.

It is normally recommended to save drawings in the webp or png format rather than the GIF format. But for animation, as the animated versions of the PNG format, MNG and APNG, have limited support, GIF is the only real option for animation.

Characteristic

Management

Creating

Convert Video to Gif

#basic
ffmpeg -i video.avi video.gif -hide_banner
ffmpeg -i video_320x180.mp4 agif_320x180.gif -hide_banner

# reduce resolution
ffmpeg -i video_320x180.mp4 -vf scale=160:90 agif_160x90.gif -hide_banner

# reduce Frame per second to 10
ffmpeg -i video_320x180.mp4 -r 10 agif_r10_320x180.gif -hide_banner

Resize and Crop

Compression

Command line

Diff

gifdiff with giscle

Concat

Giffsicle

gifsicle --delay 50 -- loop=3 pic1.gif pic2.gif pic3.gif > animation.gif

Options:

Explode

gifsicle --explode anim.gif

Documentation / Reference