PixelForge: a pixel art and animation studio in Python and SDXL

A desktop studio for game developers that combines character generation, conversion to pixel art, automatic rigging, animation and tilemap editing in one application.

Type
AI-assisted pixel art and animation studio
Key stack
Python, PySide6 (Qt), PyTorch, Stable Diffusion XL, NumPy, OpenCV
Full stack (10)

Python, PySide6 (Qt), PyTorch, Stable Diffusion XL, NumPy, OpenCV, SciPy, scikit-learn, Pillow, Inno Setup

My role
Design, architecture and development (sole developer)

Summary

  • The whole chain, from image generation and pixel conversion to animation and export, in one desktop application.
  • The core layer is independent of the interface; engine layers can be tested without Qt.
  • Every user action is a command: undo, shortcuts, scripting and menus are fed from one place.
On this page (7 sections)
  1. Context
  2. Architecture
  3. SDXL on limited hardware
  4. Pixel art integrity
  5. Animation and rigging
  6. Distribution and licensing
  7. Quality process
Production chain
  1. Image generation SDXL, ControlNet and IP-Adapter
  2. Pixel conversion Pixel art converter, indexed-colour filters
  3. Animation and rigging Timeline, skeleton, IK, deformation
  4. Export Project, Aseprite, PNG and tilemap

Context

PixelForge is an independent product for game developers that combines AI image generation, conversion to pixel art, automatic rigging, animation and tilemap editing in one Windows desktop application. I handled design, architecture and development on my own.

Technologies: Python 3.10, PySide6 (Qt), NumPy, PyTorch, Diffusers (SDXL), OpenCV, SciPy, scikit-learn, Pillow.

Architecture

core/        Document, Layer, Selection, History, CommandRegistry, ScriptEngine, PluginManager
tools/       Strategy-based tools (brush, fill, bone, mesh, particles, tilemap…)
filters/     Colour, convolution, outline and indexed-colour filters
io/          Project, Aseprite and PNG import/export
tilemap/     Tileset, layer, renderer, export
ai/          SDXL engine, pixel art downscaler, character rotator, ControlNet / IP-Adapter
animation/   Timeline, templates, retargeting, reference motion capture, region transfer
rigging/     Skeleton, IK, deformation, physics, wind, collision
ui/          Qt interface: docks, canvas, timeline, theme
  • One-way dependencies. core knows nothing about the UI; the UI talks to it only through the command registry and signals, so engine layers are testable without Qt.
  • Command pattern. Every user action is a command. Undo/redo, shortcuts, scripts and menus are fed from one place, and a complex animation edit can be undone as a single atomic document transaction.
  • Strategy pattern. A new tool can be added without touching existing code.
  • Background workers. Generation and analysis run in QThread-based workers with progress, cancellation, memory estimation and resource guards.

SDXL on limited hardware

SDXL components (CLIP → UNet → VAE) are moved onto the GPU one at a time and offloaded back to the CPU, and LoRA weights are baked into the model. This “VRAM choreography” lets generation run on consumer graphics cards. Text-to-image, image-to-image, inpainting, 13 samplers, 6 schedulers, LoRA, VAE and model selection are supported.

Pixel art integrity

The downscaler that turns a 1024×1024 generation into a 64×64 sprite preserves edges and extracts a palette with K-Means. Region transfer and rendering never introduce new palette colours, verified by a zero-new-colours metric in the benchmark.

Animation and rigging

Skeleton extraction from painted body-part maps, an IK solver, skin binding and pixel deformation; idle, walk, run, jump, attack, hit and death templates with retargeting. Motion capture from reference video uses a multi-hypothesis tracker with Viterbi/beam global sequence optimisation; occluded limbs are predicted and every frame is tagged with its source (real frame, mirrored, user, procedural). The animation engine is deterministic: the same input gives the same output, which makes golden-master regression testing possible.

Distribution and licensing

Heavy dependencies such as PyTorch, CUDA and Qt led to an embedded-Python approach: a small PyInstaller launcher runs an embedded Python environment. Source is shipped in compiled form, the Windows installer is built with Inno Setup, and licensing and activation use a hardware fingerprint and the itch.io API.

Quality process

  • More than sixty numbered stages, each with a goal and acceptance criteria.
  • Benchmarks and stress tests; health gates that block a release when quality metrics drop, and golden-master regression.
  • UI contract tests that verify every feature is reachable from the interface.
  • Two independent code-review rounds before the final release, with findings turned into regression tests.
  • Experimental features are not labelled stable until verified in a real user environment.
Scale and performance targets

About 145k lines of Python and more than 120 automated test files. Region transfer performance targets: 128×128 → 0.4 s, 512×512 → 2.2 s, 1024×1024 → 8.4 s.