agentleFS
godot-fungodot-fun/godot-agent/.agents/skills/image-sprite-sheet-split/SKILL.md

image-sprite-sheet-split

Skill202 starsChanged 13 days agoMITView on GitHub

Splits uniform sprite sheet grids into individual frame PNGs using FFmpeg crop. Use when the user wants to split sprite sheets, extract animation frames, divide grid images into cells, cut 4x4 or NxM sheets, slice tilesets, or prepare frames for background removal.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.

    line 12
  2. Very specific:

    Run split_frames.py through the python manifest entry (.dependency/python/).

    line 14
  3. Distinctive:

    Do not hand-write FFmpeg crop commands — use the bundled script.

    line 15
  4. Very specific:

    Ensure python and ffmpeg are populated in .dependency/manifest.json (see dependency-manager).

    line 24
  5. Distinctive:

    Use the bundled script, not hand-written FFmpeg crop commands.

    line 91

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image Sprite Sheet Split

Split uniform grid sprite sheets into individual PNG frames via FFmpeg crop. Preserves per-cell dimensions and alpha. Does not remove backgrounds — run image-remove-background on frames afterward if needed.

Rules

When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.

  • Run split_frames.py through the python manifest entry (.dependency/python/). Never use host python, py, or python3.
  • Do not hand-write FFmpeg crop commands — use the bundled script.
  • Single file only. Pass one sprite sheet with --image; directories are not supported.
  • Grid size required. Supply --grid COLSxROWS before running (e.g. 4x4, 6x3).
  • populated: false is not a reason to skip. Install first, set populated: true, retry the same command.
  • Never overwrite sources. Output goes into <image-dir>/image-sprite-sheet-split/<sheet-stem>/ by default (or under -o).
  • Never copy or move input images. Pass the user's actual file path.

Setup (first run)

  1. Ensure python and ffmpeg are populated in .dependency/manifest.json (see dependency-manager).
  2. FFmpeg must include ffprobe beside ffmpeg in the same bin/ folder.

Quick Start

Default: <image-dir>/image-sprite-sheet-split/<sheet-stem>/ beside the input sheet:

# 4×4 sheet → image/effects/image-sprite-sheet-split/fire_sheet/fire_sheet_001.png … fire_sheet_016.png
.dependency/python/python .ai/image-sprite-sheet-split/split_frames.py --image image/effects/fire_sheet.png --grid 4x4

Custom output root:

.dependency/python/python .ai/image-sprite-sheet-split/split_frames.py --image image/effects/fire_sheet.png --grid 4x4 -o image/effects/frames/
# → image/effects/frames/fire_sheet/fire_sheet_001.png …

Defaults

OptionDefaultNotes
--imageRequiredSingle sprite sheet image file
--gridRequiredCOLSxROWS (columns first), e.g. 4x4, 6x3
Outputimage-sprite-sheet-split/<stem>/Use -o / --output for a custom root directory

Frames are exported row-major (left→right, top→bottom): _001, _002, …

Supported inputs: .png, .jpg, .jpeg, .webp, .gif, .bmp, .tif, .tiff, .avif, .ico.

When to use

Good fitPoor fit
Uniform N×M grid (4×4, 3×6, 8×1)Irregular / free-form layouts
Gemini or Aseprite-style sheetsPacked texture atlases with variable frame sizes
Sheets without gutters or border paddingSheets with grid lines, gutters, or outer padding
Preparing frames for per-frame background removalAuto-detecting grid size (must be supplied)

rembg on whole sheets removes animation content — split frames first, then remove backgrounds per frame if needed.

Agent Workflow

  1. Confirm grid size — ask or infer from context (4x4, 3x6, etc.).
  2. Trial first — split one sheet, inspect image-sprite-sheet-split/<stem>/001.png and the last frame.
  3. Check warnings — if image size is not evenly divisible, verify cell crops still look correct.
  4. More sheets — run once per file with the same grid settings.
  5. Revert — delete the output folder; sources are never modified.

Examples

4×4 explosion sheet (2048×2048 → 16 × 512×512):

.dependency/python/python .ai/image-sprite-sheet-split/split_frames.py --image sheet.png --grid 4x4

6×3 sheet:

.dependency/python/python .ai/image-sprite-sheet-split/split_frames.py --image sheet.png --grid 6x3

Agent Notes

  1. Use the bundled script, not hand-written FFmpeg crop commands.
  2. Missing Python/FFmpeg → populate .dependency/ per dependency-manager, retry same command.
  3. Do not copy, move, or replace the source with frame outputs — tell the user where the output folder is.
  4. Need transparent frames → split first, then image-remove-background on each frame.

Troubleshooting

IssueFix
FFmpeg not foundPopulate ffmpeg in .dependency/manifest.json
Directory passed to --imageRun once per sheet; this skill accepts image files only
Output already existsDelete the existing frame folder or choose a different -o path
Wrong frame countVerify --grid matches the sheet layout
Misaligned cropsSheet may have gutters/padding — this skill expects a clean uniform grid
Unused pixels warningImage size is not evenly divisible by the grid; inspect output frames
Need transparent framesSplit first, then image-remove-background on frames

CLI

Copy-paste commands: cli/image-sprite-sheet-split.md

Related

  • Transparent cutouts per frame: image-remove-background
  • Trim frame borders: image-trim

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.