A protobuf-based binary format for sprite sheets, with geometry tracing and Three.js rendering.
Protosprite is a monorepo containing a suite of packages for working with sprite sheets. It takes Aseprite source files and produces compact binary .prs (sprite data) and .prsg (collision geometry) files, which can be loaded and rendered in Three.js with animation, layer control, and visual effects.
Source .ase/.aseprite files containing frames, layers, tags, and z-index overrides.
The CLI invokes the Aseprite binary in batch mode to produce a packed spritesheet PNG and JSON metadata.
protosprite-core parses the Aseprite JSON export and constructs the typed data model (sprites, frames, layers, animations).
Bin-packing optimizes the sprite atlas, then optional PNG compression via pngquant reduces file size.
The data model serializes to the compact .prs binary format via @bufbuild/protobuf.
Optional geometry tracing produces .prsg files with collision polygons, convex decomposition, and de-duplicated vertex/shape pools.
The wire format definitions for .prs (sprite.proto) and .prsg (sprite_geometry.proto).
protosprite-three loads .prs files, resolves pixel sources, and creates textured sprite instances.
Each sprite is a Mesh with a custom shader pipeline supporting animation, layer effects, and outlines.
The interactive demo application built with React and Three.js.
The CLI supports additional output formats including TypeScript types, preview images, frame exports, and geometry JSON.
| Package | Description |
|---|---|
protosprite-core |
Core data model, protobuf serialization, Aseprite import, and sprite sheet packing |
protosprite-geom |
Polygon geometry tracing, simplification, convex decomposition, and .prsg encoding |
protosprite-cli |
CLI for building .prs/.prsg files from Aseprite sources |
protosprite-three |
Three.js loader and renderer with animation, layer effects, and custom shaders |
protosprite-three-demo |
Interactive demo application (live) |
Protobuf-encoded SpriteSheet message containing sprite metadata (frames, layers, animations) and either embedded or externally-referenced PNG atlas data. Compact binary with variable-length integers, typically 30-50% smaller than equivalent JSON.
Protobuf-encoded SpriteGeometry message containing traced collision polygons with de-duplicated vertex and shape pools. Includes both per-layer and composite geometry with convex decomposition for physics engines.