sprite-atlas-slicer
Skill0 starsChanged 2 months agoMITView on GitHub
Use when splitting transparent PNG sprite sheets, sprite atlases, game UI atlases, imagegen-generated asset sheets, 图集, 切图, or 散图 into individual cropped PNG sprites for game engines.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Fable-Forge/fableforge-agent-skillsword for word, first seen Sep 21, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Fable-Forge/fableforge-agent-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- llms.txtllms.txt
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Use this skill to turn a transparent PNG atlas into separate game-ready PNG files.
- Very specific: line 22
Run scripts/slice_sprite_atlas.py on the transparent atlas.
- Very specific: line 24
If auto slicing is imperfect, create or edit a boxes JSON and rerun with --boxes.
- Distinctive: line 38
Use manual boxes when sprites sit too close together:
- Distinctive: line 76
Before claiming completion, verify:
- Very specific: line 86
Do not call imagegen to cut an already generated atlas into individual files.
- Distinctive: line 87
Do not crop by the black preview background.
- Very specific: line 88
Do not trust auto slicing when sprites touch or sit very close.
- Very specific: line 89
When a crop still contains neighboring fragments, add clear rectangles or keep_largest in the boxes JSON.
- Very specific: line 90
Do not put outputs directly into a Cocos assets/ folder unless the user wants import metadata created.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sprite Atlas Slicer
全局协作约定
- 编码、审查、重构或修 bug 时,可显式触发
karpathy-guidelines:先说明假设和取舍,保持改动外科式,定义可验证成功标准。 - 汇报长日志、长文档、工具输出、agent 工作或调试证据时,可显式触发
reporting-discipline:先给结论、关键证据、风险和下一步,不默认粘贴大段原文。 - 常用触发语:
use karpathy-guidelines and reporting-discipline,或“用 karpathy 打底,并按 reporting discipline 汇报”。
Overview
Use this skill to turn a transparent PNG atlas into separate game-ready PNG files. Prefer deterministic pixel slicing over imagegen for this step; generation is for making or editing art, while slicing should preserve the existing pixels.
Workflow
- Confirm the input is a transparent PNG atlas. If the source has a flat chroma-key background, remove it first with the
imagegenskill's chroma-key helper. - Run
scripts/slice_sprite_atlas.pyon the transparent atlas. - Inspect
_preview_contact_sheet.pngfor obvious issues: adjacent fragments, missing text/icon pieces, over-cropped edges, or tiny noise sprites. - If auto slicing is imperfect, create or edit a boxes JSON and rerun with
--boxes. - Deliver the output directory,
manifest.json,_preview_contact_sheet.png, and zip archive if requested.
Quick Commands
Auto slice a well-spaced transparent atlas:
python scripts/slice_sprite_atlas.py \
--input /path/to/atlas.png \
--out-dir /path/to/slices \
--zip /path/to/slices.zipUse manual boxes when sprites sit too close together:
python scripts/slice_sprite_atlas.py \
--input /path/to/atlas.png \
--out-dir /path/to/slices \
--boxes /path/to/boxes.json \
--zip /path/to/slices.zipThe boxes file can be either a list or an object with an items list:
[
{ "name": "button_build", "box": [1005, 750, 1133, 897] },
{
"name": "aircraft_passenger_plane",
"box": [620, 474, 953, 695],
"clear": [[0, 0, 118, 92]],
"keep_largest": false
}
]clear rectangles are local to the sprite box. Use keep_largest: true when a sprite has one main alpha component plus detached noise.
Defaults
- Alpha threshold:
8 - Output padding:
2px - Auto grouping dilation:
8px - Minimum component area:
100px - Output names:
001_<name>.png
Adjust --dilate down when separate sprites merge together. Adjust it up when one sprite splits into pieces such as dashed outlines, text, or detached icon badges.
Validation
Before claiming completion, verify:
python scripts/slice_sprite_atlas.py --input /path/to/atlas.png --out-dir /tmp/slices --zip /tmp/slices.zipThen inspect the preview and confirm every sprite PNG is RGBA and non-empty. The script writes a manifest with source boxes and output sizes for review.
Common Mistakes
- Do not call
imagegento cut an already generated atlas into individual files; it will redraw and drift. - Do not crop by the black preview background. Crop from the alpha channel.
- Do not trust auto slicing when sprites touch or sit very close. Use
--boxesfor production assets. - When a crop still contains neighboring fragments, add
clearrectangles orkeep_largestin the boxes JSON. - Do not put outputs directly into a Cocos
assets/folder unless the user wants import metadata created.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

