Sprite Production
Use when creating game sprites, transparent character or item cutouts, animation frames, sprite sheets, or atlases. Produces genuine RGBA assets, removes generated backgrounds when needed, preserves frame alignment, packs deterministic sheets, and verifies alpha instead of treating PNG or a checkerboard as transparency.
Skill metadata
| Source | Bundled (installed by default) |
| Path | skills/creative/sprite-production |
| Version | 1.0.0 |
| Author | VibeOS |
| License | MIT |
| Platforms | macos, windows, linux |
| Tags | sprites, sprite-sheet, game-art, transparent-png, rgba, cutout, animation, image-generation |
| Related skills | creative-studio, comfyui, raster-edit |
Reference: full SKILL.md
The following is the complete skill definition that VibeOS loads when this skill is triggered. This is what the agent sees as instructions when the skill is active.
Sprite Production
Overview
Create reusable game/UI sprites as real transparent raster assets. The final
deliverable is an RGBA PNG with transparent pixels outside the subject, not a
full rectangular illustration, a painted checkerboard, or an RGB file that
happens to use the .png extension.
Use ${SKILL_DIR}/scripts/sprite_pipeline.py for the deterministic pixel work.
Generation supplies source art; the script removes backgrounds, validates
alpha, and packs frames without asking an image model to imitate file-format
semantics.
Invoke it explicitly as /sprite-production or with the Russian alias
/спрайт. Both commands load this same skill; the alias does not duplicate or
fork its instructions.
When to Use
- A character, enemy, item, prop, effect, portrait, card element, or UI cutout must be composited over changing backgrounds.
- The user asks for a sprite, animation frames, a sprite sheet, or an atlas.
- Generated art has a white, coloured, scenic, or checkerboard background that must become genuine transparency.
- Several frames need consistent canvas size, anchor, ordering, and metadata.
Do not use this skill for a complete scene or background illustration where
the rectangular canvas is the intended asset. Use pixel-art for deliberate
low-resolution pixel construction; use this skill afterward if those frames
also need alpha validation or sheet packing.
Asset Contract
A production sprite passes all of these checks:
- The file is PNG in
RGBA,LA, or indexed mode with real transparency. - Alpha contains both
0and255: some pixels are fully transparent and some are fully opaque. - The visible subject is not clipped and has intentional transparent padding.
- Animation frames share one canvas size and one anchor; they are not trimmed independently unless offsets are recorded and the runtime consumes them.
- A sheet is assembled from individual verified frames, never generated as a single collage by the image model.
- The final sheet has machine-readable frame rectangles in JSON.
output_format=png is not evidence of transparency. Always run validate.
Workflow
1. Define the sprite family
Before generation, establish the view (front/side/isometric), crop (full body, waist-up, item-only), lighting direction, scale, frame canvas, anchor, and animation order. Completion criterion: every requested frame has a stable name and the same visual contract.
For animation, prefer names with an explicit order such as
idle_00.png, idle_01.png, walk_00.png.
2. Generate individual source frames
Use image_generate once per distinct frame or use an edit-capable model with
the approved base frame as a reference. Keep the character description,
camera, scale, light, and palette byte-for-byte stable; change only the pose or
state. Do not ask for a ready-made grid.
When the active provider supports native alpha, request a transparent PNG and
still validate the result. When it does not (including ordinary local
HiDream/ComfyUI VAEDecode → SaveImage workflows), request:
One isolated subject, complete silhouette fully visible, centered, generous empty padding, flat uniform high-contrast background, no floor, no cast shadow, no scenery, no text, no border, no checkerboard, no extra objects.
Choose a background colour absent from the subject. A flat background is load-bearing for the dependency-free colour cutout fallback.
Completion criterion: each source contains exactly one complete subject and no silhouette touches the canvas edge.
3. Produce real alpha cutouts
Inspect a source first:
python "${SKILL_DIR}/scripts/sprite_pipeline.py" inspect source.png
Create an RGBA sprite:
python "${SKILL_DIR}/scripts/sprite_pipeline.py" cutout \
source.png exports/hero_idle_00.png --engine auto
Engine selection:
| Engine | Use when | Behaviour |
|---|---|---|
auto | Default | Preserves useful existing alpha; otherwise uses installed rembg, then falls back to colour removal |
rembg | Detailed hair, fur, translucent edges, or a non-uniform background | Semantic foreground segmentation; may download its model on first use |
color | Flat uniform generated background | Removes pixels similar to the sampled border colour; no extra dependency |
alpha | Input already has correct transparency | Refuses a fully opaque input instead of fabricating success |
For an explicit chroma colour and a soft edge:
python "${SKILL_DIR}/scripts/sprite_pipeline.py" cutout \
source.png exports/item.png --engine color \
--background '#00ff66' --tolerance 28 --feather 1.2
Do not use --trim independently on animation frames. For standalone items,
--trim --padding 24 is appropriate.
Completion criterion: the command returns ok: true and its validation block
reports alpha range [0, 255].
4. Validate every frame
python "${SKILL_DIR}/scripts/sprite_pipeline.py" validate exports/*.png
Validation exits non-zero when any input is RGB, fully opaque, fully
transparent, unreadable, or empty. Fix the source/cutout rather than converting
RGB to RGBA with alpha 255; that only changes the channel layout.
Completion criterion: failed is 0 for the complete frame set.
5. Pack the sheet
python "${SKILL_DIR}/scripts/sprite_pipeline.py" sheet \
exports/idle_00.png exports/idle_01.png exports/idle_02.png \
exports/idle_03.png --output exports/hero_idle_sheet.png \
--columns 4 --align bottom
The default cell is the largest input width and height. Use explicit
--frame-width and --frame-height only when the runtime has a fixed cell
contract. Inputs larger than an explicit cell are scaled down without
upscaling smaller frames. The companion JSON defaults to the sheet name with a
.json suffix and records cell rectangles plus visible-content offsets.
Completion criterion: both PNG and JSON exist, the sheet validation passes, and the JSON frame order matches the requested animation order.
Iteration Rules
- Regenerate a badly clipped or inconsistent source; background removal cannot restore missing anatomy or enforce character identity.
- Prefer semantic
rembgextraction for hair/fur or complicated backgrounds. Colour removal is intentionally limited to flat backgrounds. - Keep master cutouts. Build runtime sheets as derivatives so one bad frame can be replaced without regenerating everything.
- Review sprites on at least two contrasting checker-free backgrounds (light and dark) to reveal halos. A checkerboard is useful only as a viewer layer; it must never be baked into pixels.
- For directional characters, do not mirror asymmetric clothing, weapons, text, or lighting unless the game design explicitly permits it.
Common Pitfalls
- “PNG means transparent.” PNG supports RGB and RGBA. Validate alpha.
- Prompt-only transparency. Diffusion often paints white or checkerboard pixels. Use a native alpha backend or a cutout stage.
- Generated sprite sheet. Model-made grids have inconsistent cells, repeated/missing poses, and no trustworthy metadata. Generate frames first.
- Per-frame trimming. The character jumps because every crop changes the anchor. Preserve a shared canvas or consume recorded offsets at runtime.
- Opaque RGBA. Adding an all-255 alpha channel does not remove a background.
- Green fringe. Regenerate on a neutral contrasting colour or use
rembg; raising colour tolerance aggressively erodes the subject.
Verification Checklist
- Every master frame validates with alpha range
[0, 255]. - No subject touches the canvas boundary or loses required detail.
- Light- and dark-background previews show no obvious halo.
- Animation frame canvases and anchors are consistent.
- Sheet order matches the named sequence.
- Sheet PNG and JSON metadata were both delivered.
- Source masters remain separate from runtime derivatives.