GIF Optimizer
Reduce GIF file size by optimizing colors and frames.

Click or drag and drop to add files

Image Tools

GIF Optimizer

Reduce GIF file size by optimizing colors and frames.

GIF Optimizer shrinks animated GIFs by re-encoding them with a tighter palette and optional frame cleanup — "Reduce GIF file size by optimizing colors and frames." Drop a GIF, set "Max Colors" (2–256, default 256) and "Lossy Compression" (0–100, default 10), toggle duplicate-frame removal or frame-disposal optimization, and press "Optimize GIF".

The result panel shows "Original Size", "Optimized Size", "Savings" (%), and frame count (original → optimized); the success toast reads "Optimized! Saved {n}%". Download comes back as optimized.gif. Decoding uses gifuct-js and re-encoding uses gif.js workers — entirely local, no upload, no AI.

How it works

The file is parsed with gifuct-js (parseGIF + decompressFrames). When "Remove duplicate frames" is checked, byte-equal patches are collapsed before encoding; frames are composited onto a full-size canvas for consistent dimensions.

Re-encoding runs through gif.js GifEncoder with workers: 2, quality mapped from the Lossy Compression level (1–100), and workerScript /gif.worker.js. The "Optimize frame disposal" checkbox is accepted in the schema and passed in options; the encoder path primarily uses delay+copy per frame. Savings = (1 − optimized/original) × 100.

How to use

  1. Drop a GIF (accept image/gif; "Could not read image dimensions" flags undecodable files).
  2. Set "Max Colors" between 2 and 256 (default 256).
  3. Set "Lossy Compression" between 0 and 100 (default 10).
  4. Toggle "Remove duplicate frames" and/or "Optimize frame disposal".
  5. Click "Optimize GIF" (label becomes "Optimizing...").
  6. Read Original Size, Optimized Size, Savings (%), and the frame count change.
  7. Click "Download Optimized GIF" for optimized.gif, or "Start Over" to adjust and retry.

Tips

  • Max Colors 256 keeps quality; drop to 64–128 for flat graphics and sprites without visible banding.
  • Lossy 10 is a mild default — raise toward 50–80 for real size wins when some artifacts are acceptable.
  • Duplicate-frame removal helps GIFs full of held frames (common in screen recordings and reaction loops).
  • Already-optimized GIFs can show ~0% savings — try more colors reduction or higher lossy before giving up.
  • Watch the "Optimized! Saved {n}%" toast for a quick pass/fail read before downloading.

GIF Optimizer FAQ

Does optimization upload the GIF?

No — parsing and re-encoding both run locally in the browser.

Which libraries are involved?

gifuct-js for decoding frames and gif.js for re-encoding with 2 workers.

What does Max Colors do?

It caps the color palette (2–256) used during re-encode — fewer colors, smaller file.

Why might the size not shrink?

Already-optimized GIFs or conservative Lossy/Max Colors settings can yield close to 0% savings.

What is the output filename?

optimized.gif.

Credits

ShareTweet
More Image Tools

Command Palette

Search for a command to run...