mcpField
S
sprite-animator

sprite-animator

github.com/olafs-worldCreative & media741 installsUpdated 37w ago
Repository

About sprite-animator

sprite-animator is a command-line tool for turning images into looping pixel-art GIFs. It uses Gemini to generate 16-frame sprite sheets and offers presets for several animation types.

Key features

  1. 01Image-to-GIF animation
  2. 02Gemini-generated 16-frame sprite sheets
  3. 03Idle, wave, bounce, and dance presets
  4. 04Optional pixelation step for photos
  5. 05Export sprite sheets and individual frames

Use cases

  1. 01Animate a photo as a pixel-art character
  2. 02Create idle or action loops from drawings
  3. 03Save generated frames for further editing

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/olafs-world/sprite-animator --skill sprite-animator

After installing, type/sprite-animatorin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

pyproject.toml
.gitignore
LICENSE
README.md
uv.lock
.github/workflows/
ci.yml
sprite_animator/
cli.py
__init__.py
template.py

Details

From the project README

Sprite Animator

Turn any image into an animated pixel art sprite GIF. Uses Gemini image generation to create 16-frame sprite sheets, then assembles them into looping GIFs.

Requirements

  • GEMINI_API_KEY or GOOGLE_API_KEY env var must be set
  • Install: uv tool install sprite-animator (or uvx sprite-animator for one-off runs)

Quick Usage

# Best quality for photos — two-step converts to pixel art first, then animates
sprite-animator -i photo.png -o dance.gif -a dance --two-step -s 256 -r 2K

# From drawings or pixel art (single step is fine)
sprite-animator -i drawing.png -o idle.gif -a idle -s 256 -r 2K

Animation Types

  • idle — gentle breathing + blink (default)
  • wave — arm raise → wave → return
  • bounce — crouch → jump → land
  • dance — lean, spin, jump — full party mode

Key Options

FlagDescriptionDefault
-iInput image pathrequired
-oOutput GIF pathrequired
-aAnimation type (idle/wave/bounce/dance)idle
-sOutput sprite size in px128
-rGeneration resolution (1K/2K)1K
-dFrame duration in ms100
--two-stepPixelate first, then animate (better for photos)off
--keep-sheetSave raw sprite sheetoff
--keep-framesSave individual frame PNGsoff

Tips

  • Use --two-step for photos of real people — Gemini loses likeness otherwise
  • Use -r 2K for noticeably better quality
  • Use -d 180 for more natural playback speed (default 100ms is fast)
  • Save good base pixel art sprites and reuse them for different animations
  • On Telegram, send GIFs as documents to avoid MP4 conversion

Python API

from pathlib import Path
from PIL import Image
from sprite_animator.cli import ANIMATION_PRESETS, generate_sprite_sheet, create_gif, call_gemini, get_api_key
from sprite_animator.template import create_template, extract_frames

api_key = get_api_key()
preset = ANIMATION_PRESETS["dance"]

# Create template and generate sprite sheet
template = create_template(cols=4, rows=4, labels=preset["labels"])
template.save("template.png")

generate_sprite_sheet(
    api_key=api_key,
    input_image=Image.open("input.png"),
    template_path=Path("template.png"),
    output_path=Path("sheet.png"),
    prompt=preset["prompt"],
    resolution="2K",
)

# Extract frames and build GIF
frames = extract_frames(Image.open("sheet.png"), cols=4, rows=4)
create_gif(frames, Path("output.gif"), frame_duration=180, size=256)

Comments

Markdown supported