Aseprite to atlas tool — compact and metadata-aware.
Utility designed to simplify the 2D graphics production pipeline by packing sprite sheets into tight atlases with rich metadata export.
- Compact atlas packing — tight layout for sprite sheets.
- Named animations — extract animations directly from the atlas.
- Layer ordering — control draw order from Aseprite.
- Frame time export — per-frame timing information.
- Meta layers — hitboxes and points computed into consumable data for your game engine.
pipx install .make build-binaryThis produces a runnable binary at ./bin/atlas.
pyatlas -i <input_folder> -o <output_folder> -m <manifest_filename>| Prefix | Meaning | Example |
|---|---|---|
# |
Animation layer | #jump |
@hb |
Hitbox meta layer | @hb.body |
@pt |
Point meta layer | @pt.origin |
Layers prefixed with # are exported as animation frames. Example: #jump, #idle.
The program computes the axis-aligned bounding box of non-transparent pixels (alpha > 127) for each frame. This allows defining hitboxes directly as pixel art — especially useful for per-frame hitboxes on complex characters or bosses.
The program computes the barycenter (mean of the pixel centres) of all non-transparent pixels per frame, as unrounded floats. Useful for anchor points, attach points, or origin references.
The label is everything after @hb. / @pt., kept verbatim: @hb.hurtbox.arm_left has the label hurtbox.arm_left. A dot is part of the name, not nesting. Allowed: letters, digits, _, and . between parts. Labels are free-form; the exporter gives none of them special treatment.
A state is an Aseprite frame tag; a file without tags is a single state. Box and point metadata live on the state node, z-order on the file node:
hero = {
_metadata = { z_order = { "body" } }, -- file node
atk = { -- state node (tag)
_metadata = {
boxes = {
solidbox = { const = { x = 9, y = 13, w = 6, h = 11 } },
hitbox = { frames = { [2] = { x = 20, y = 11, w = 3, h = 6 },
[4] = { x = 21, y = 10, w = 2, h = 8 } } },
["hurtbox.arm_left"] = { frames = { ... } },
},
points = {
origin = { const = { x = 12.5, y = 23.5 } },
},
},
body = { x = 0, y = 0, w = 24, h = 24, n = 4 },
},
}- Each label is either
{ const = V }(present with the same value on every frame of the state) or{ frames = { [i] = V } }, a sparse table keyed by 1-based frame index within the state. A missing index means the label is absent on that frame; there is no fallback. Never use#/ipairsonframes. - A label absent on every frame of a state is not emitted. Empty
boxes,pointsand_metadataare omitted. - Boxes are integer
{x, y, w, h}and points float{x, y}, in sprite pixels, y-down, relative to the frame's top-left. - For an untagged file the state node is the file node. For an
#autofile the state node is the region leaf itself, next tox, y, w, h, n. - Frame indices assume every layer exports every frame: the Aseprite export runs without
--trim/--ignore-empty.
- Error: an
@layer that is not@hb.<label>/@pt.<label>(e.g.@hbx.foo,@pt), an invalid label, or two layers with the same name. - Warning: a state where
solidboxis present on some frames but not all; a state with box/point metadata but noorigin(ororigin.<variant>, e.g.origin.floor) point. These names are constants at the top ofpyatlas/parse_jsons.py.
pixi run testsFixtures are real .aseprite files generated by tests/fixtures/make_fixtures.lua; their exports are committed so the tests do not need Aseprite. After changing the fixtures run aseprite -b --script tests/fixtures/make_fixtures.lua && ./tests/fixtures/export_fixtures.sh, and UPDATE_GOLDEN=1 pixi run tests after an intended manifest format change.