gifsicle

Create, edit, manipulate, and get information about GIF files. More information: https://www.lcdf.org/gifsicle.

gifsicle path/to/input.gif --optimize=3 -o path/to/output.gif

gifsicle -b path/to/input.gif --unoptimize

gifsicle path/to/input.gif '#0' > path/to/first_frame.gif

gifsicle *.gif --delay=10 --loop > path/to/output.gif

gifsicle -b path/to/input.gif --optimize=3 --lossy=100 --colors=16 --dither

gifsicle -b path/to/input.gif --delete '#0-9' '#20-'

gifsicle -b --crop starting_x,starting_y+rect_widthxrect_height --scale 0.25 --flip-horizontal --rotate-90|180|270 path/to/input.gif