Extract RPG Asset Board
Convert one RPG asset-board image into reviewed, individually named PNG assets. Use the bundled script for deterministic image processing; use visual judgment to review candidate boxes and outputs.
Workflow
- Inspect the source image and identify:
- rectangular terrain/path tiles that must retain their painted background;
- props/buildings/decorations that should become transparent;
- nearby objects that belong together and should share one crop.
- Locate a Python runtime with
Pillowandnumpy. Prefer the workspace dependency runtime when available. - Generate initial candidate boxes:
python scripts/rpg_asset_board.py detect SOURCE.png --layout layout.json
- Review
layout.detect-preview.jpgand editlayout.json.- Give every asset a descriptive lowercase
id. - Set
typetotileorprop. - Merge related fragments by replacing them with one enclosing box.
- Set
keep_largest_component: trueonly when a prop crop contains disconnected neighboring art. - Delete false positives and expand boxes that clip shadows or painted edges.
- Give every asset a descriptive lowercase
- Extract the assets:
python scripts/rpg_asset_board.py extract SOURCE.png --layout layout.json --out OUTPUT_DIR --clean --zip
- Inspect
preview_contact_sheet.jpgon a checkerboard. - Fix layout boxes or alpha thresholds and rerun until no asset is clipped, contaminated, empty, or missing.
Output Contract
Produce:
tiles/*.png: rectangular terrain and path pieces with their painted ground intactprops/*.png: tightly cropped RGBA PNG filesmanifest.json: IDs, types, sizes, source boxes, and processing settingspreview_contact_sheet.jpg: visual QA sheet- optional
.ziparchive
Do not claim success before inspecting the contact sheet and confirming the validation summary reports zero errors.
Processing Guidance
- Prefer one logical game object per output, not one connected component per output.
- Keep shadows when they visually ground props, unless the user asks for shadowless assets.
- Treat doors/windows designed to overlay buildings as props.
- Treat square/rectangular grass, dirt, edge, and path pieces as tiles.
- Do not force a grid size unless the user names a target engine and tile size.
- For complex textured backgrounds, hair-like edges, translucent materials, or overlapping assets, explain that deterministic background removal may need manual masking or image editing.
See references/layout-format.md for the layout schema and tuning fields.