For the same 5-second 480×270 animation:
| Format | File size | Quality |
|---|
| GIF (256 colors, optimized) | 800 KB | Limited to 256 colors |
| APNG (full color) | 600 KB | Full color, lossless |
| WebP (animated, lossy) | 200 KB | Full color, slight artifacts |
| WebP (animated, lossless) | 480 KB | Full color, lossless |
| MP4 (H.264) | 80 KB | Best compression but video |
WebP is dramatically smaller than GIF or APNG. MP4 is even smaller but is video, not image.
| Format | Max colors | Transparency |
|---|
| GIF | 256 per frame | 1-bit (full or none) |
| APNG | 16.7 million | 8-bit alpha (full transparency) |
| WebP (lossy) | 16.7 million | 8-bit alpha |
| WebP (lossless) | 16.7 million | 8-bit alpha |
GIF's 256-color limit produces visible banding on photographic content. APNG and WebP handle full color cleanly.
For transparent animations on light/dark backgrounds: APNG or WebP (full alpha). GIF's 1-bit alpha produces hard edges.
| Browser | Animated GIF | APNG | Animated WebP |
|---|
| Chrome | Yes | Yes | Yes |
| Firefox | Yes | Yes | Yes |
| Safari | Yes | Yes (since Safari 8) | Yes (since Safari 14) |
| Mobile Safari | Yes | Yes | Yes |
| Edge | Yes | Yes | Yes |
| Older browsers | Yes | Limited | No |
For 2026 web delivery: any of the three works in modern browsers. WebP is best for new content.
| Platform | GIF | APNG | WebP |
|---|
| Gmail | Yes | Limited | Limited |
| Outlook (Web) | Yes | Limited | Limited |
| Outlook (Desktop) | Yes (newer) | No | No |
| Apple Mail | Yes | Yes | Yes |
| iMessage | Yes | Yes | Yes |
| Slack | Yes | Yes | Limited |
| Discord | Yes | Yes | Yes |
| Microsoft Teams | Yes | Limited | Limited |
For email-friendly delivery: GIF is the safest bet. APNG and WebP have spotty email client support.
Use animated GIF for:
- Email delivery (broadest compatibility)
- Slack, Discord (universal)
- Older browser support (legacy systems)
- Tweets and social (most still expect GIF)
- Forum signatures and embeds (legacy)
GIF's 256-color limit is acceptable for cartoon-style content, simple animations, and short loops.
For broader animation context, see Lottie JSON to MP4.
Use APNG for:
- High-color animations on websites (browsers support it)
- Replacing GIF where modern browsers are guaranteed
- Transparency-critical content (full 8-bit alpha)
- Open-source projects (royalty-free, well-supported)
APNG is essentially "GIF with full color and transparency." Drop-in replacement for modern web.
Use animated WebP for:
- Web pages with modern browser audience
- High-volume image hosting (significant bandwidth savings)
- Animation-heavy sites (small file sizes compound)
- CDN-delivered content (size matters at scale)
For web delivery in 2026: WebP is the best modern format. The size savings (60-75% vs GIF) compound across page loads.
For converting between formats:
# GIF to APNG
ffmpeg -i input.gif -plays 0 output.apng
# GIF to WebP (animated)
ffmpeg -i input.gif -loop 0 -lossless 0 -compression_level 6 output.webp
# APNG to GIF
ffmpeg -i input.apng -filter_complex "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif
# WebP (animated) to GIF
ffmpeg -i input.webp -filter_complex "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif
# Video to animated WebP
ffmpeg -i input.mp4 -vf "fps=15,scale=480:-1:flags=lanczos" -loop 0 -lossless 0 -compression_level 6 output.webp
The two-pass palette generation produces dramatically better GIF quality than single-pass.
For batch processing patterns, see Batch Processing Files Guide.
Optimal frame rate for animated images:
| Frame rate | Use case |
|---|
| 10-15 fps | Casual web (smaller files) |
| 24 fps | Cinematic feel |
| 30 fps | Smooth motion |
| 60 fps | Very smooth, larger files |
For most web animation: 15 fps. The eye doesn't notice the difference much at small sizes, and file size drops significantly.
For animated WebP:
# Lossy with high compression
ffmpeg -i input.gif -loop 0 -lossless 0 -quality 75 output.webp
# Lossless with high compression
ffmpeg -i input.gif -loop 0 -lossless 1 -compression_level 6 output.webp
Quality 75 lossy WebP is visually similar to quality 90 GIF at 30% the file size.
For animated GIF optimization:
# gifsicle for further optimization
gifsicle -O3 --lossy=80 input.gif > output.gif
gifsicle is the standard tool for GIF optimization. Reduces file size 30-50%.
WebP doesn't loop infinitely: missing loop count. Add -loop 0 flag.
APNG plays only first frame in some browsers: incomplete chunk handling. Re-encode with FFmpeg.
GIF colors look posterized: 256-color palette quantization. Use better palette generation:
ffmpeg -i input.mp4 -filter_complex "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" output.gif
Email client strips animation: client doesn't support format. Provide static fallback.
Mobile bandwidth concern: animated images compound. Use WebP or video MP4 for mobile-first.
Cultural inertia. The "GIF" name is universally understood. Email and messaging compatibility wins on broadest delivery.
Yes for high-volume sites. Use HTML <picture> element:
<picture>
<source srcset="animation.webp" type="image/webp" />
<img src="animation.gif" alt="Animation" />
</picture>
Browsers serve WebP when supported, GIF when not.
For longer or higher-quality animations: MP4 is dramatically smaller. For short loops with frequent embedding: image formats are simpler (no <video> element needed).
Yes, full 8-bit alpha. Better transparency than GIF (1-bit) or animated WebP (8-bit, similar).
HEIC supports animation (HEICS). Apple ecosystem only. Limited tool support outside Apple.
ffmpeg -i input.mp4 -filter_complex "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
For broader video-to-animation, see Lottie JSON to MP4.
For animated images in 2026: animated WebP for web (smallest, modern), APNG for high-color animation with broader browser support, GIF for email and messaging compatibility. Convert between them with FFmpeg. Use <picture> element for WebP-with-fallback. Our GIF maker handles single-file conversions.