Change GIF Quality
Adjust GIF quality by changing color depth, resolution, dithering, and frame rate. Reduce file size or enhance visual fidelity online.
About
GIF files use the LZW compression algorithm over a palette of up to 256 indexed colors per frame. File size is governed by three factors: the number of colors in the Global or Local Color Table (N), pixel dimensions (W × H), and the total frame count (F). Reducing any one of these parameters decreases file size, but introduces quantization artifacts, spatial aliasing, or temporal stutter respectively. Misapplying these reductions produces banding in gradients, loss of fine detail, and choppy animation. This tool decodes each frame from the raw GIF89a binary, applies Median Cut color quantization, optional Floyd-Steinberg or ordered dithering, bilinear resolution scaling, and frame subsampling, then re-encodes a standards-compliant GIF.
The relationship between color count and palette bits is b = ceil(log2(N)), where b ranges from 1 to 8. Lower b improves LZW compression ratios because fewer distinct codes appear in the stream. Dithering trades spatial noise for perceptual color depth, a necessary compensation when dropping below 64 colors. This tool processes entirely in-browser using a Web Worker. No data leaves your device. Approximations arise from the Median Cut algorithm, which partitions the RGB cube rather than finding a globally optimal palette. For photographic GIFs, expect diminishing returns below 32 colors.
Formulas
The GIF palette size in bits determines the minimum LZW code width and directly affects compression efficiency:
where b = bits per pixel (palette bit depth, range 1 - 8), N = number of colors in the quantized palette.
Uncompressed frame data size before LZW encoding:
where W = width in pixels, H = height in pixels. Total raw data across all retained frames:
where F = original frame count, k = frame keep interval (1 = all, 2 = every other, 3 = every third).
Floyd-Steinberg error diffusion distributes the quantization error e = cold − cnew to neighboring pixels with the kernel:
where cold = original pixel color channel value, cnew = nearest palette color channel value. Resolution scaling uses bilinear interpolation, sampling the four nearest source pixels weighted by fractional distance.
Reference Data
| Colors | Palette Bits | Typical Size Reduction | Visual Impact | Best Use Case |
|---|---|---|---|---|
| 256 | 8 | 0% (baseline) | None | Original quality preservation |
| 128 | 7 | 5 - 15% | Minimal | Subtle optimization |
| 64 | 6 | 15 - 30% | Minor banding in gradients | Web thumbnails |
| 32 | 5 | 30 - 50% | Noticeable on photos | Icons, simple animations |
| 16 | 4 | 45 - 65% | Strong posterization | Flat-color graphics, logos |
| 8 | 3 | 60 - 75% | Heavy color loss | Monochrome-like art |
| 4 | 2 | 70 - 85% | Extreme reduction | Retro/pixel art effects |
| 2 | 1 | 80 - 90% | Binary (two colors) | Black & white silhouettes |
| Resolution Scaling Effects | ||||
| Scale 100% | 0% | None | Original dimensions | |
| Scale 75% | 40 - 45% | Slight softening | Email/messaging | |
| Scale 50% | 70 - 75% | Noticeable downscale | Inline chat reactions | |
| Scale 25% | 90 - 94% | Major detail loss | Micro-thumbnails | |
| Dithering Modes | ||||
| None | Best compression | Hard banding | Flat-color source | |
| Floyd-Steinberg | Moderate compression | Organic noise pattern | Photographic GIFs | |
| Ordered (Bayer 4×4) | Good compression | Regular dot pattern | Retro aesthetic | |
| Frame Rate Effects | ||||
| Keep all frames | 0% | Smooth animation | Quality priority | |
| Drop every 2nd | ≈50% | Slight stutter | Size priority | |
| Drop every 3rd | ≈33% | Choppy on fast motion | Balanced | |