Skip to content

1B05H1N/pixelate-gif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixelate-gif

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.

Features

  • Works on any GIF (animated or static)
  • Adjustable pixelation factor
  • Preserves animation timing and loop count
  • No external dependencies beyond Pillow and imageio

Installation

pip install pillow imageio

Usage

python pixelate_gif.py input.gif pixelated.gif --factor 10
  • input.gif: Path to your source GIF
  • pixelated.gif: Output path
  • --factor: (Optional) Pixelation factor (default: 8)

How it works

  1. Reads the GIF frame-by-frame
  2. Downscales and upscales each frame with nearest-neighbor
  3. Re-encodes all frames, preserving timing and loop info

Tweaks

  • Change factor for chunkier or finer pixelation
  • Use Image.BILINEAR for a softer look
  • Crop and pixelate only a region for selective effects

Example

Original GIF Pixelated GIF
Original nacho-libre.gif Pixelated nacho-libre-pixelated.gif

This shows how the script pixelates every frame while preserving animation and looping.

About

Pixelate GIFs easily by applying a customizable pixelation effect to each frame with this Python script.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages