0x0funky/video2dsprite
Grok Build ONLY. Turn a 2D character still into smooth animation sprites via image_gen/image_edit base → image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled sprites (strip/grid/GIF). Use when the user wants video-to-sprite, motion capture from generated video, smoother run/walk cycles from dense frames, or runs /video2dsprite. Do NOT use on Codex/Claude — only Grok Build has image_to_video. Prefer generate2dsprite for crisp pixel sheets without video.
npx skills add https://github.com/0x0funky/agent-sprite-forge --skill video2dsprite
Convert a base 2D character image into dense animation sprites using Grok Build's native video tools.
base still → image_to_video (in-place motion) → extract frames → chroma key → sample/normalize → strip / grid / GIF
| Runtime | Supported? |
| --- | --- |
| Grok Build (xAI) | Yes — requires image_gen / image_edit + image_to_video (or reference_to_video) |
| Codex / Claude / other agents | No — they lack Grok video tools. Tell the user this skill is Grok Build only and offer $generate2dsprite instead |
If image_to_video is missing from the tool list, stop and explain. Do not fake motion with code-drawn frames.
This skill is an optional denser-motion path. It does not replace $generate2dsprite:
| Use $generate2dsprite when… | Use $video2dsprite when… |
| --- | --- |
| Crisp pixel sheets, fixed grids, identity-critical heroes | User wants denser intermediate poses / smoother feeling loops |
| Attack/cast body sheets, prop packs, engine atlases | Experimenting with video-sourced run/walk/idle motion |
| Production default for most game sprites | User explicitly asks for video → frames → sprites |
Video softens pixels, drifts identity, and leaves chroma fringes. Always QC; for production heroes, prefer $generate2dsprite unless the user wants the video look.
Infer from the user request:
subject: character / creature description, or path to existing stillaction: run | walk | idle | attack | custom motion phraseview: usually side (side-scroller). topdown is harder — warn and keep camera lockedduration: 6 (default) or 10 secondsframe_counts: which denser sets to export, default 8,16,24,48cell_size: output sprite cell, default 128anchor: feet (default for side locomotion) | centerbg: solid #FF00FF (required for chroma)name: output slugout_dir: working folder (default ./sprites/video2dsprite/<name>/ or project-relative)$generate2dsprite alternative.image_gen or image_edit from a reference). Then call image_to_video.#FF00FF / pure magenta). Required for flood-fill chroma.image_gen / image_edit or a user/local still. Scripts only postprocess.Pick the smallest useful run:
$generate2dsprite per action; only use video for locomotion if requested$generate2dsprite, not videoCreate:
<out_dir>/
base/
video/
frames-raw/
frames-clean/
sprite/ # default 8-frame set + denser x16/x24/x48
prompt-used.txt
pipeline-meta.json
README.txt
Options:
#FF00FF if neededimage_gen with solid magenta background, full body, side view, centeredimage_edit from user reference onto magenta, preserve identityBase requirements:
Save as <out_dir>/base/<name>-base.png.
Write the exact image prompt into prompt-used.txt.
image_to_videoCall Grok image_to_video:
image: path to the base stillduration: 6 (default) or 10resolution_name: 480p unless user asks 720pprompt: one short present-tense shot (see references/prompt-rules.md)Mandatory motion constraints in the prompt:
Copy the returned video to <out_dir>/video/<name>-<duration>s.mp4.
If video tools are unavailable, stop (platform gate).
Run the processor (ffmpeg + Pillow + numpy):
python skills/video2dsprite/scripts/video2dsprite.py process \
--video <out_dir>/video/<name>-6s.mp4 \
--out-dir <out_dir> \
--name <name> \
--frame-counts 8,16,24,48 \
--cell-size 128 \
--body-height 100 \
--foot-y 118 \
--fps 0
Notes:
--fps 0 = extract every decoded frame (use source fps)--frame-countsOptional: only re-sample denser sets from existing cleaned frames:
python skills/video2dsprite/scripts/video2dsprite.py sample \
--clean-dir <out_dir>/frames-clean \
--out-dir <out_dir> \
--frame-counts 16,24,48 \
--cell-size 128
Visually check:
If identity drifts hard or pixels are too soft, fall back to $generate2dsprite for production sheets and keep the video set as motion reference only.
Report paths only (unless user asked to wire into a game):
video/*.mp4sprite/x16|x24|x48/sprite/run-strip-N.png, run-grid-N.png, run-preview-N.gifpipeline-meta.jsonDo not modify game code unless requested.
image_to_video over reference_to_video (compose multi-ref with image_edit first if needed)Pros: denser intermediates → often feels smoother than 4–8 discrete gen poses.
Cons: softer pixels, identity drift, chroma fringe, multi-cycle 6s clips are not a single perfect loop, heavier assets.
Rule of thumb: 8→16→24 usually gains smoothness; 48 is often diminishing returns; 145 raw frames are for sampling, not all for runtime.
$generate2dsprite — primary sheet pipeline (Codex + Grok when image gen exists)$generate2dmap — maps; not used here$video2dsprite — Grok Build exclusive motion densification pathTake 0x0funky/video2dsprite from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.