gifsicle
Create, edit, and optimize GIF images and animations
TLDR
Optimize a GIF for smaller file size
SYNOPSIS
gifsicle [options] [input.gif ...] [-o output.gif]
DESCRIPTION
gifsicle is a command-line tool for creating, editing, and optimizing GIF images and animations. It can manipulate existing GIFs, combine multiple images into animations, extract frames, and significantly reduce file sizes.
The optimization feature is particularly valuable: level 3 optimization can reduce GIF file sizes by 30-50% without quality loss by storing only changed pixels between frames. Frame selection uses '#' notation (e.g., '#0' for the first frame, '#0-5' for a range).
PARAMETERS
-o, --output file
Write output to file.--optimize, -O [level]
Optimize GIF (1=store only changed, 2=shrink, 3=max).--resize WxH
Resize to specified dimensions.--resize-width W
Resize to width, maintaining aspect ratio.--resize-height H
Resize to height, maintaining aspect ratio.--scale factor
Scale by factor (e.g., 0.5 for half size).--delay time
Set frame delay in hundredths of a second.--loopcount n
Set loop count (0 or forever for infinite).--colors n
Reduce to n colors (2-256).--color-method method
Color reduction method: diversity, blend-diversity, median-cut.--crop x,y+WxH
Crop to specified region.--rotate-90, --rotate-180, --rotate-270
Rotate image.--flip-horizontal, --flip-vertical
Flip image.--unoptimize, -U
Unoptimize (expand each frame to full image).--explode
Write each frame to separate file.--info, -I
Show information about the GIF.--batch, -b
Modify files in place.
CAVEATS
Input must be valid GIF format. Very large GIFs may require significant memory. Heavy optimization can be slow on complex animations. Color reduction may cause visible quality loss. Does not convert from other formats (use ImageMagick for that).
HISTORY
gifsicle was written by Eddie Kohler starting in 1997 at UCLA. It became a standard tool for GIF manipulation in the open-source community, particularly for web optimization.
