The single biggest performance win most sites can make is replacing GIF with MP4 or WebM. A 10 MB GIF becomes a 500 KB MP4 — that's 20× smaller for the same visible content. Twitter, Reddit, and every modern messaging platform silently do this conversion under the hood. This tool exposes the same conversion for your own workflow. Uses ffmpeg.wasm (H.264 baseline profile) for maximum compatibility including iOS Safari's autoplay-inline mode.
MP4 vs. GIF — why the size difference?
H.264 (MP4's default codec) uses temporal compression: it stores full I-frames every ~30 frames and stores just the differences between consecutive frames in between. GIF stores every frame independently in a low-color palette. For any content with continuous motion, H.264 is 15–25× smaller. Add in-loop deblocking and 24-bit color and you get better-looking output too.
Autoplay tricks
To make an MP4 auto-loop like a GIF, ship it with autoplay muted loop playsinline. iOS respects playsinline to play inline instead of fullscreen; muted is required for autoplay in most browsers; loop replaces GIF's infinite loop. This is the pattern Twitter and Reddit use.
Quality and encoding effort
CRF (constant rate factor, 0–51 with lower = higher quality) defaults to 23 — good for typical web use. Below 18 you're wasting bytes; above 28 you'll see compression artifacts. Encoding preset (fast, medium, slow) trades encoding time for compression efficiency — slow saves ~10% at 3× the encoding time.