English · 简体中文 2dimg2motion.skill -- not a filter that "makes an image move", but a runnable framework for generating game animation frames Spritesheet delivery pipeline via key-pose redrawing, identity locking, and limb topology constraints, it
FAQ
2dimg2motion is a Claude Code plugin with 2 hand-picked skills for content work, indexed on Flowy. Install it with the command on its page. It includes img2mo-learn, img2mo-std. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
$ npx -y skills add WU-HAOTIAN34/2dimg2motion --agent claude-code
Repo: WU-HAOTIAN34/2dimg2motion

2dimg2motion.skill is a 2D game-animation generation skill for Codex / Claude Code / Agent Skills. It takes one static character, creature, vehicle, weapon, or prop image and generates a style-consistent transparent action sequence that can be packed into a spritesheet.
It is not a "single-image motion filter". Filters usually translate, rotate, scale, or warp local image layers; the core of this skill is whole-character key-pose redraw: first lock the character identity, then let the model redraw complete key poses, then generate in-between frames, with local scripts handling transparency, canvas normalization, packing, and validation.
AI can easily draw characters that look like they belong to the same series, but it is much harder to draw continuous motion for the same character. Game animation adds more requirements:
This repository turns those lessons into an executable workflow: analyze the baseline image, establish the identity lock, design action beats, generate a shared key-pose sheet, generate in-betweens, remove the background, normalize frames, pack assets, validate structure, and visually inspect the result.
Put the repository into your Agent Skills directory. Keep the repository structure intact, because the main skill, sub-skills, scripts, references, and project knowledge files refer to each other.
Codex example:
git clone https://github.com/WU-HAOTIAN34/2dimg2motion.git $env:USERPROFILE\.codex\skills\2dimg2motion
Claude Code example:
git clone https://github.com/WU-HAOTIAN34/2dimg2motion.git ~/.claude/skills/2dimg2motion
You can also run it directly from this repository during local development. Confirm the dependency:
python -m pip install pillow
In Codex or Claude Code, provide a baseline image and describe the motion:
/2dimg2motion use sample/s3.png to generate an arm-swing attack animation
Or:
Generate a walk action from this character image.
/2dimg2motion use sample/s7.png to generate a sword-slash action.
/2dimg2motion use sample/s1.png to make a heavy ground-smash attack animation.
The main skill runs the full workflow: analyze the baseline image, establish the identity lock, design key poses at 02/05/08/11, generate in-betweens, remove the background, normalize frames, pack the spritesheet, and output preview.gif and manifest.json.
If the input image is too large, tightly cropped, visibly white-backed, or lacks enough transparent margin for attacks or walking motion, call the standardization sub-skill first:
/img2mo-std s7
/img2mo-std sample\s7.png
It resolves the image path and calls the script to create a standardized baseline image:
python scripts\standardize_baseline.py sample\s7.png
Useful options:
python scripts\standardize_baseline.py sample\s7.png --check-only
python scripts\standardize_baseline.py sample\s7.png --subject-max 360 --margin-ratio 0.75
python scripts\standardize_baseline.py sample\s7.png --output sample\s7-standard.png
Default output:
sample\<input-stem>-standard.png
The standardized image should become the 00 and 13 baseline frame for later animation generation.
If you have reference videos, existing outputs, failed attempts, GIFs, spritesheets, Spine assets, or frame folders, the skill can extract reusable project knowledge from them:
/img2mo-learn output\s3-arm-swing-attack
/img2mo-learn motion\some-reference-folder
/img2mo-learn sample\attack-reference.mp4
Learned notes are written to:
img2mo-knowledge/
|-- index.md
|-- learnings.jsonl
|-- action-patterns.md
|-- style-patterns.md
|-- prompt-patterns.md
`-- failures.md
Future animation generations read this project-level knowledge first, improving action timing, prompt clauses, canvas margins, and failure checks.
Scripts are for non-creative post-processing and validation only. They do not draw motion.
Standardize a baseline image:
python scripts\standardize_baseline.py sample\s7.png
Convert transparent fullframe PNGs into a white-background GIF preview:
python scripts\fullframes_to_gif.py output\s3-arm-swing-attack\fullframe --output output\s3-arm-swing-attack\preview.gif --duration-ms 75
Validate the 14-frame delivery structure:
python scripts\validate_14frame_pattern.py --baseline sample\s3-standard.png --keyframes-dir output\s3-arm-swing-attack\keyframe --fullframes-dir output\s3-arm-swing-attack\fullframe --preview output\s3-arm-swing-attack\preview.gif --prefix s3-arm-swing-attack
On success, it prints:
OK
The input is usually one static PNG:
sample/s3.png
Describe the action you want:
use sample/s3.png to generate an arm-swing attack animation
The output is a standard delivery bundle:
output/<action-id>/
|-- keyframe-prompts.md # prompts and identity lock for 02/05/08/11
|-- keyframe/ # 4 keyframes at fixed indices 02, 05, 08, 11
|-- fullframe/ # 14 transparent RGBA sequence frames, fixed indices 00-13
|-- spritesheet.png # horizontal packed spritesheet
|-- contact-sheet.png # visual review sheet
|-- preview.gif # 14-frame white-background playback preview
`-- manifest.json # canvas, frame order, topology lock, keyframe indices, and processing notes
fullframe/*.png contains the transparent frames you should import into your engine. preview.gif is only a human-readable playback preview.
Before generation, record the character invariants: face, eyes, silhouette, proportions, palette, outline, clothing, weapon, horns, tail, wings, claws, markings, and other accessories. Every later prompt inherits this identity lock.
For attacks, waves, sword swings, tail sweeps, and similar actions, the skill records the active limb and anchor limb in screen space, for example:
activeLimb: screen-right arm
anchorLimb: screen-left arm
This reduces failures like "the right hand suddenly becomes the left hand", "the weapon switches hands", or "the tail root disappears".
Default actions use fixed anchors:
00 -> 02 -> 05 -> 08 -> 11 -> 13
00 and 13 are the baseline image. 02/05/08/11 are the four model-generated key poses. The other frames are in-betweens generated from adjacent anchors. This structure keeps short actions compact and easy to validate.
Keyframes and in-betweens must be generated by an image model as complete character poses. Scripts may only perform non-creative post-processing: baseline standardization, cell splitting, chroma-key removal, canvas normalization, GIF generation, spritesheet packing, and validation.
The repository includes a validator that checks frame count, naming, RGBA mode, canvas size, transparent corners, whether 00/13 match, whether keyframes are pixel-identical to their corresponding fullframes, and whether the GIF is a 14-frame white-background preview.
| Action | Common Beats |
|---|---|
| idle | settle -> rise -> settle |
| walk / move | contact -> down -> passing -> up -> opposite contact |
| attack | guard -> anticipation -> acceleration -> contact -> follow-through -> recovery |
| block | raise guard -> hold -> return |
| hit / suffer | impact -> recoil -> squash/stretch -> recovery |
| death | imbalance -> fall -> impact -> rest |
| born / spawn | small/curled shape -> unfold -> full identity |
| skill / cast | anticipation -> charge -> peak cast -> recovery |
02/05/08/11.1/2/2/2/1 insertion plan..
|-- SKILL.md # main skill instructions and full generation contract
|-- references/ # key-pose redraw and motion prompt references
|-- skills/img2mo-std/ # baseline standardization sub-skill
|-- scripts/
| |-- standardize_baseline.py
| |-- fullframes_to_gif.py
| `-- validate_14frame_pattern.py
|-- sample/ # input sample images
|-- examples/ # README showcase assets
|-- motion/ # local motion reference library
`-- img2mo-knowledge/ # project-level learned knowledge
MIT © 2026 Haotian Wu
.gitignore
agents/
openai.yaml
examples/
e1res.gif
e2res.gif
e3res.gif
e4res.gif
e5res.gif
e6res.gif
e7res.gif
github-header-1.png
logo.png
s1-spritesheet .png
s1.png
s2-spritesheet.png
s2.png
s3-spritesheet.png
s3.png
s4-spritesheet.png
s4.png
s5-spritesheet.png
s5.png
s6-spritesheet.png
s6.png
LICENSE
README-CN.md
README.md
references/
keypose-redraw.md
motion-prompt-patterns.md
scripts/
fullframes_to_gif.py
standardize_baseline.py
validate_14frame_pattern.py
SKILL.md
skills/
img2mo-learn/
SKILL.md
img2mo-std/
SKILL.md© 2026 Flowy · Free and open source
Built for Claude Code · Not affiliated with Anthropic