Generate 2D game art assets — characters, monsters, NPCs, equipment, items, VFX, tiles, UI icons, and animation frame sequences — through OpenAI-compatible (gpt-image-2, gpt-image-1, dall-e) or Gemini image backends. Use when Codex needs to create or iterate on sprites and game-ready art with a configurable provider/base-url/model, transparent or chroma-key cutouts, and outputs prepared for downstream cutout (抠图), Spine skeletal animation, and paper-doll (纸娃娃) equipment-layering systems.
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Generate 2D game art assets — characters, monsters, NPCs, equipment, items, VFX, tiles, UI icons, and animation frame sequences — through OpenAI-compatible (gpt-image-2, gpt-image-1, dall-e) or Gemini image backends. Use when Codex needs to create or iterate on sprites and game-ready art with a configurable provider/base-url/model, transparent or chroma-key cutouts, and outputs prepared for downstream cutout (抠图), Spine skeletal animation, and paper-doll (纸娃娃) equipment-layering systems.
Game Asset Generation
Use this skill to produce 2D game art and short animation sets, then prepare it
for downstream pipelines: cutout (抠图), Spine skeletal animation, and paper-doll
(纸娃娃) equipment layering. The bundled scripts/ cover multi-provider image
generation, image editing for consistency, batch jobs, and background removal.
The generator is provider-agnostic. The same CLI talks to:
OpenAI-compatible Images API — POST {base}/images/generations, /images/edits
(models like gpt-image-2, gpt-image-1, dall-e-3).
OpenAI-compatible Responses API — POST {base}/responses with the
image_generation tool.
Consistency is the core challenge for game art. Keep one stable subject
description block across all frames or equipment layers; vary only pose,
motion, VFX, or the single swapped part.
For tight consistency, prefer the edit subcommand: feed the base/reference
image plus a change instruction instead of regenerating from scratch. This is
how paper-doll layers and animation frames stay on-model.
Always state in the prompt: canvas/size, background mode (transparent or flat
#00FF00), outline/style anchor, subject, and an avoid clause.
Prefer readable silhouettes over detail. If a sprite reads muddy at the target
size, simplify the prompt rather than adding detail.
Treat backgrounds (parallax, scenes) differently from sprites: larger aspect
ratios, and usually skip cutout entirely.
Workflow
Lock the deliverable. Output path, naming pattern, frame/layer count, and
whether the result is a raw generation, a cleaned cutout, or a final asset.
Read references/naming-conventions.md if fitting an existing tree.
Build the prompt from references/prompt-templates.md. Include: style
anchor, canvas/size, background mode, subject, pose/frame action, consistency
instruction for multi-frame work, and an avoid clause (blur, realism,
gradients, watermarks).
Generate.
OpenAI gpt-image-2, transparent PNG (no chroma key needed):
Gemini pixel sprite on green, auto chroma-keyed + downscaled:
python "$ASSET_GEN" generate \
--backend gemini --model gemini-2.5-flash-image \
--prompt "chibi retro pixel art warrior, 48x48 canvas, 1px dark outline, solid flat pure green (#00FF00) background, no shadow" \
--out art/player/warrior/idle_00.png --downscale 48
Edit for consistency / paper-doll. Keep pose and anchor stable by editing
the base image instead of regenerating:
python "$ASSET_GEN" edit \
--backend openai --model gpt-image-2 \
--image art/hero/base.png \
--prompt "the exact same character in the same pose and position, now wearing steel plate armor; keep transparent background" \
--out art/hero/equip/armor_steel.png
OpenAI edits accept an optional --mask (transparent area = region to change)
and multiple --image inputs for composition.
smart_remove_bg.py auto-detects the dominant corner color, so it works for
green screens and other solid backgrounds (white, etc.). Transparent
OpenAI outputs usually need no cutout at all.
Validate at final size. Check silhouette readability, no background
fringing, intact outline, and correct alpha. For animation, preview at
8–12 FPS; for paper-doll/Spine, confirm every layer shares the same canvas,
anchor point, and registration. See references/pipeline-spine-paperdoll.md.
OpenAI gpt-image-2 / gpt-image-1: native transparent background, multi-
image edits, masking — best for paper-doll, Spine parts, and clean cutouts.
dall-e-3: no transparency; generate then cutout via smart_remove_bg.py.
Gemini gemini-2.5-flash-image: fast, strong for pixel art; no transparent
mode, so use the green-screen + chroma-key path. Good default for cheap
iteration; reserve higher-quality models for hero assets and final art.
References
references/api-backends.md: provider/url/model/env config and troubleshooting