skills/sprite-pipeline-2d/SKILL.md
```markdown --- name: sprite-pipeline-2d description: AI agent skill for the Sprite-Pipeline project — a reusable Python pipeline for turning video/frames into clean 256×256 horizontal sprite sheets with matting, review, and browser preview. triggers: - "create a sprite sheet from video" - "extract frames for animation" - "build sprite strip from frames" - "matte background from sprite frames" - "set up sprite sheet pipeline" - "convert animation video to sprite sheet" - "review an
npx skillsauth add aradotso/trending-skills skills/sprite-pipeline-2dInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
---
name: sprite-pipeline-2d
description: AI agent skill for the Sprite-Pipeline project — a reusable Python pipeline for turning video/frames into clean 256×256 horizontal sprite sheets with matting, review, and browser preview.
triggers:
- "create a sprite sheet from video"
- "extract frames for animation"
- "build sprite strip from frames"
- "matte background from sprite frames"
- "set up sprite sheet pipeline"
- "convert animation video to sprite sheet"
- "review and promote sprite sheet output"
- "view sprite sheets in browser"
---
# Sprite-Pipeline 2D
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
A reusable Python pipeline that converts ordered animation frames (extracted from video) into clean horizontal `256×256` sprite strips, with optional background matting, JSON reports, contact-sheet previews, and a static browser viewer.
---
## What It Does
| Stage | Tool | Input → Output |
|---|---|---|
| Extract frames | `tools/extract_frames_ffmpeg.py` | `Videos/` → `work/extracted/` |
| Matte backgrounds | `tools/matte_frames.py` | `work/extracted/` → `work/matted/` |
| Build sprite strip | `tools/animation_pipeline.py` | frames dir → sprite sheet PNG + JSON report |
| Cleanup / repack | `tools/cleanup_repack.py` | loose frames → tidy cell folders |
| Contact sheet | `tools/contact_sheet.py` | frames dir → preview PNG |
| Resize | `tools/resize_sprites.py` | sheet PNG → scaled PNG |
| Gallery manifest | `tools/build_sprite_gallery_manifest.py` | `Final Sprite Sheets/` → `sprite_gallery_manifest.js` |
| Browser viewer | `sprite_viewer.html` | manifest → interactive preview |
---
## Installation & Setup
### 1. Clone and create virtual environment
```bash
git clone https://github.com/LayrKits/Sprite-Pipeline.git
cd Sprite-Pipeline
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# macOS
brew install ffmpeg
# Windows
winget install Gyan.FFmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
ffmpeg -version
python tools/animation_pipeline.py --help
Sprite-Pipeline/
├── Videos/
│ └── To Be Processed/ # drop source .mp4/.mov here
├── work/
│ ├── extracted/<character>/<action>/ # raw frames from ffmpeg
│ └── matted/<character>/<action>/ # frames with alpha/white bg removed
├── Final Sprite Sheets/
│ └── <GameName>/<CharacterName>/<animation>/
├── Cleanup/
├── tools/
├── docs/
├── skills/
├── sprite_viewer.html
├── sprite_gallery_manifest.js
└── sprite_gallery_pins.json
python tools/extract_frames_ffmpeg.py \
--input "Videos/hero_run.mp4" \
--output "work/extracted/hero/run" \
--fps 12
--fps controls how many frames per second are extracted (match your target animation rate).frame_0001.png, frame_0002.png, …python tools/matte_frames.py \
--input "work/extracted/hero/run" \
--output "work/matted/hero/run" \
--threshold 240
--threshold (0–255): pixels with all RGB channels above this value are made transparent.python tools/animation_pipeline.py \
--input "work/matted/hero/run" \
--output "work/previews/hero_run_sheet.png" \
--size 256 \
--report "work/previews/hero_run_report.json"
--size sets the cell dimensions (default 256; sheet will be N×256 wide by 256 tall).--report writes a JSON file with frame count, dimensions, dropped frames, and warnings.python tools/contact_sheet.py \
--input "work/matted/hero/run" \
--output "work/previews/hero_run_contact.png" \
--cols 8
python tools/resize_sprites.py \
--input "work/previews/hero_run_sheet.png" \
--output "work/previews/hero_run_sheet_128.png" \
--size 128
# Manually copy approved sheet + cells after review:
mkdir -p "Final Sprite Sheets/MyGame/Hero/run"
cp work/previews/hero_run_sheet.png "Final Sprite Sheets/MyGame/Hero/run/"
cp -r work/matted/hero/run/ "Final Sprite Sheets/MyGame/Hero/run/cells/"
python tools/build_sprite_gallery_manifest.py
# then open sprite_viewer.html in a browser (no server needed)
# 1. Extract
python tools/extract_frames_ffmpeg.py \
--input "Videos/To Be Processed/hero_run.mp4" \
--output "work/extracted/hero/run" \
--fps 12
# 2. Matte
python tools/matte_frames.py \
--input "work/extracted/hero/run" \
--output "work/matted/hero/run" \
--threshold 240
# 3. Build sheet + report
python tools/animation_pipeline.py \
--input "work/matted/hero/run" \
--output "work/previews/hero_run_sheet.png" \
--size 256 \
--report "work/previews/hero_run_report.json"
# 4. Review the JSON report
cat work/previews/hero_run_report.json
# 5. Promote if approved
mkdir -p "Final Sprite Sheets/MyGame/Hero/run"
cp work/previews/hero_run_sheet.png "Final Sprite Sheets/MyGame/Hero/run/"
# 6. Update viewer
python tools/build_sprite_gallery_manifest.py
open sprite_viewer.html # macOS; or just double-click on Windows/Linux
If you want to drive the pipeline from your own Python script:
import subprocess, json, pathlib
def extract_frames(video_path: str, out_dir: str, fps: int = 12):
pathlib.Path(out_dir).mkdir(parents=True, exist_ok=True)
subprocess.run([
"python", "tools/extract_frames_ffmpeg.py",
"--input", video_path,
"--output", out_dir,
"--fps", str(fps),
], check=True)
def matte_frames(in_dir: str, out_dir: str, threshold: int = 240):
pathlib.Path(out_dir).mkdir(parents=True, exist_ok=True)
subprocess.run([
"python", "tools/matte_frames.py",
"--input", in_dir,
"--output", out_dir,
"--threshold", str(threshold),
], check=True)
def build_sheet(frames_dir: str, sheet_path: str, size: int = 256) -> dict:
report_path = sheet_path.replace(".png", "_report.json")
subprocess.run([
"python", "tools/animation_pipeline.py",
"--input", frames_dir,
"--output", sheet_path,
"--size", str(size),
"--report", report_path,
], check=True)
with open(report_path) as f:
return json.load(f)
# Example usage
extract_frames("Videos/To Be Processed/hero_run.mp4", "work/extracted/hero/run", fps=12)
matte_frames("work/extracted/hero/run", "work/matted/hero/run", threshold=240)
report = build_sheet("work/matted/hero/run", "work/previews/hero_run_sheet.png", size=256)
print(f"Frames: {report['frame_count']}, Warnings: {report.get('warnings', [])}")
animation_pipeline.py writes a report like:
{
"source_dir": "work/matted/hero/run",
"output_sheet": "work/previews/hero_run_sheet.png",
"cell_size": 256,
"frame_count": 16,
"sheet_width": 4096,
"sheet_height": 256,
"dropped_frames": [],
"warnings": []
}
Check warnings and dropped_frames before promoting. Common warnings:
resize_sprites.py first)The repo ships a self-contained skill at skills/sprite-sheet-pipeline/SKILL.md.
To give an AI assistant full context, point it at that file:
Use the sprite-sheet-pipeline skill at skills/sprite-sheet-pipeline/SKILL.md
Or install the folder in the assistant's skill directory. The skill routes tasks to:
docs/reference/PROMPTING_IMAGE_MODELS.md — first poses, character refsdocs/reference/PROMPTING_VIDEO_MODELS.md — Kling/image-to-video promptsdocs/QUICKSTART.md — copy-paste processing commandsAll tools accept --help. Common shared flags:
| Flag | Default | Description |
|---|---|---|
| --input | required | Source directory or file |
| --output | required | Destination directory or file |
| --size | 256 | Cell pixel dimension (square) |
| --fps | 12 | Frame extraction rate |
| --threshold | 240 | Matte brightness cutoff (0–255) |
| --cols | 8 | Contact sheet columns |
| --report | none | Path for JSON report output |
ffmpeg: command not foundFFmpeg is not on PATH. Install it per the setup section above; it is not included in requirements.txt.
Source frames must be square before building the sheet. Run resize_sprites.py on the frames directory first, or ensure the video source is square.
The matte --threshold is too aggressive. Lower it (e.g. 200 instead of 240), or skip matting if the source already has an alpha channel.
Check dropped_frames in the JSON report. Gaps usually mean FFmpeg dropped duplicate frames. Re-extract with a lower --fps or check the source video for corrupted segments.
sprite_viewer.html shows no sheetsRun python tools/build_sprite_gallery_manifest.py after promotion. The viewer reads sprite_gallery_manifest.js from the same directory — both must be present.
Activate the virtual environment: source .venv/bin/activate (or .venv\Scripts\activate on Windows), then retry.
Keep out of the repo by default:
Videos/)work/)Only commit tiny, intentional reference assets that are documented in code or tests.
development
```markdown --- name: compose-performance-skills description: Install and use the skydoves/compose-performance-skills agent skill library to diagnose and fix Jetpack Compose performance issues including stability, recomposition, lazy layouts, modifiers, side effects, and build configuration. triggers: - "my composable recomposes too often" - "LazyColumn drops frames during scroll" - "diagnose Compose stability issues" - "fix unnecessary recomposition in Jetpack Compose" - "optimize Com
development
Headless iOS Simulator manager with host-side HID input injection, 60fps streaming, and device farm web UI for iOS 26
development
```markdown --- name: claude-code-game-studios description: Turn Claude Code into a full 49-agent game dev studio with 72 workflow skills, automated hooks, and a real studio hierarchy for Godot, Unity, and Unreal projects. triggers: - "set up claude code game studios" - "use ai agents for game development" - "set up game dev studio with claude" - "add game studio agents to my project" - "how do I use claude code for game dev" - "set up godot unity unreal ai workflow" - "49 agents g
development
```markdown --- name: xq-py-quantum-vm description: Python implementation of the Quip Network's quantum virtual machine (xqvm) triggers: - quantum virtual machine python - xqvm quip network - quantum circuit simulation python - xq-py quantum vm - quip network quantum python - simulate quantum gates python - quantum vm xqvm - xqvm-py quantum circuit --- # xq-py Quantum Virtual Machine > Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection. `xqvm-py` is a Python impl