A pure-Python script to pixelate every frame of a GIF. Down-samples each frame to lose detail, then upscales with nearest-neighbor interpolation for a blocky, retro look.
- Works on any GIF (animated or static)
- Adjustable pixelation factor
- Preserves animation timing and loop count
- No external dependencies beyond Pillow and imageio
pip install pillow imageiopython pixelate_gif.py input.gif pixelated.gif --factor 10input.gif: Path to your source GIFpixelated.gif: Output path--factor: (Optional) Pixelation factor (default: 8)
- Reads the GIF frame-by-frame
- Downscales and upscales each frame with nearest-neighbor
- Re-encodes all frames, preserving timing and loop info
- Change
factorfor chunkier or finer pixelation - Use
Image.BILINEARfor a softer look - Crop and pixelate only a region for selective effects
| Original GIF | Pixelated GIF |
|---|---|
This shows how the script pixelates every frame while preserving animation and looping.