Pixel
AI-facing pixel-art production pipeline turning raw strips into palette-locked sprites, normal maps, and sheets.
End-to-end pixel-art processor that normalizes AI-generated sprite strips onto exact pixel grids, locks colors in OKLab space, enforces binary alpha and outlines, and generates tangent-space normal and emissive maps.
git clone https://github.com/BestRoiMedia/bestroi-game-tools.gitWhy we built it
Image generators produce blurry sub-pixels, stray palette shades, and inconsistent frame baselines. Pixel automates grid snapping, feet/body registration, key-ramp recoloring, and sprite-sheet verification.
Architecture & how it works
Detects or enforces pixel pitch, chroma-keys backgrounds, aligns frames by body or feet anchor, quantizes colors via OKLab delta-E against .gpl/.png palettes or keyramp specs, and optionally invokes onion.py for motion checks.
Key capabilities
- Automatic pixel-pitch detection, grid snapping, and multi-row strip slicing
- OKLab color-space quantization against .gpl/.png palettes and paper-doll keyramp specs
- Silhouette sel-out outline rules, binary alpha verification, and orphan-pixel detection
- Canonical head extraction (head-extract) and directional overlay compositing
- Unity tangent-space normal map (normals) and emissive mask (emissive) generation
Usage example
python3 pixel/pixel.py run ./strip.png --frames 8 --cols 4 --palette ./master.gpl --cell 48x48 --out ./out/hero
python3 pixel/pixel.py verify ./out/hero/frames --palette ./master.gpl --cell 48x48
python3 pixel/pixel.py normals ./out/hero/strip.png --out ./out/hero/strip_n.png