DevTools Logo
All posts

Better GIFs: The Palettegen Trick Every Converter Should Use

August 22, 2026 · DevTools

gif
video
ffmpeg
converter

Better GIFs: The Palettegen Trick Every Converter Should Use

GIFs autoplay everywhere — Slack, GitHub READMEs, docs — which is exactly why they refuse to die. The Video to GIF Maker converts clips locally with FFmpeg (compiled to WebAssembly), and the difference from default converters is one deliberate choice: a per-clip color palette.

The two-pass palette pipeline

Default conversion maps every frame to the same fixed 256-color web palette. The result on real footage: banding in gradients, speckle in dark areas, the general "GIF look".

The fix runs in two passes:

  1. palettegen scans the clip and builds the best 256 colors for these frames
  2. paletteuse converts the frames against that palette, with Bayer dithering to smooth the remainder

The command the tool assembles:

fps=12,scale=480:-1:flags=lanczos,split[a][b];
[a]palettegen=max_colors=256[p];[b][p]paletteuse=dither=bayer:bayer_scale=3

Lanczos scaling keeps downsizing sharp — bilinear would soften the exact details you shrunk the clip to keep.

Sizing a GIF is a budget

GIF bytes scale with width × height × FPS × seconds — quadruple any factor, quadruple the file. Working numbers: a 5-second 480px clip at 12 FPS lands around 3–5 MB (GitHub-friendly); 320px at 10 FPS for chat. The tool estimates the output size live before you commit, because the honest answer to "why is my GIF 40 MB?" is always "you already know why".

Local, cached, offline-capable

The ~31 MB engine downloads from this site once and is cached by the browser; conversions after that run fully offline. The video never leaves your device at any point.

Record the clip with the Screen Recorder, stamp drafts with the Image Watermarker, and the loop from capture to shareable artifact stays on your machine end to end.

Tools mentioned in this post