Recolor every frame of a GIF.

gifcc swaps colors, remaps whole palettes, and knocks out backgrounds across an entire animation from the command line. Try it below. It runs in your browser on Pyodide, and nothing is uploaded. When you're happy with the result, install it with one command.

Try it

Starting Python…

The first load downloads Python, numpy and Pillow (about 15 MB), so it takes a moment. Later runs are fast.

Works best on simple GIFs with flat colors, like logos, icons, pixel art and flat illustrations. Complex GIFs (photos, gradients, heavy dithering) may not work as well. Matching is by color, not position, so it's especially hard to target one specific area: every matching pixel changes, wherever it is.

1 · Input
2 · Mode

Replace pixels close to each source color. Pixels outside the tolerance are left alone.

3 · Command
Input

No GIF yet

Output

Run to see the result

Install

gifcc is on PyPI as gif-color-changer and needs Python 3.11 or newer. The command above works as-is once it's installed.

uv recommended

uv tool install gif-color-changer

pipx

pipx install gif-color-changer

One-off, no install

uvx --from gif-color-changer gifcc in.gif out.gif --map "#FFFFFF=#FF0000"

Examples

Swap two colors:

gifcc input.gif output.gif \
  --map "#FFFFFF=#FF0000" \
  --map "#000000=#00FF00"

Remove a flat background:

gifcc input.gif output.gif --map "#FFFFFF=transparent"

Rewrite a whole palette and clean up antialiased edges:

gifcc input.gif output.gif \
  --source-palette "#000000,#808080,#FFFFFF" \
  --target-palette "#1D3557,#E63946,#F1FAEE" \
  --cleanup 2

Use it from an AI agent

gifcc is a plain CLI with predictable output, so coding agents can install and drive it themselves. Two ways to hand it over:

Point the agent at llms.txt

A plain-text guide with install steps, every flag and its default, and worked examples. Paste the link into any agent's chat.

https://mpeyfuss.github.io/gif-color-changer/llms.txt

Install the Claude Code skill

Claude then recognizes GIF recoloring requests on its own. It installs gifcc if needed, finds the real colors in your GIF, and checks the result.

mkdir -p ~/.claude/skills/gifcc && curl -fsSL \
  https://mpeyfuss.github.io/gif-color-changer/SKILL.md \
  -o ~/.claude/skills/gifcc/SKILL.md

For a single project, use .claude/skills/gifcc/ instead.

Flag reference

FlagModeDefaultWhat it does
--map FROM=TOmap Replace FROM with TO. Repeatable. TO may be transparent.
--tolerance Nmap50 How close (0–255 RGB distance) a pixel must be to FROM to match.
--softness Nmap25 Blend pixels in the outer N of the tolerance range instead of replacing them outright. 0 gives a hard replacement.
--source-palette A,B,…palette Hex colors every pixel is snapped to (nearest wins).
--target-palette A,B,…palette Replacement for each source color, by position. Entries may be transparent.
--distancepalettergb rgb or weighted-rgb, which weights channels by perceived luminance.
--cleanup Npalette0 Edge-cleanup passes that absorb stray pixels into the region around them.

Alpha is never used for matching; only the RGB values change. The full guide is in the README.