Exporting
Turn animation frames into a packed atlas, Godot resources, preview GIFs and any engine's own format with one command.
mode8 export takes a folder of frames and writes what a game engine loads: one atlas PNG with its JSON, Godot 4 SpriteFrames, a preview GIF per animation, and on request the files of PixiJS, Phaser 3, LÖVE, Unity, CSS sprites or an indexed PNG. The frames keep their animation timing and share one pivot at the feet, in every format.
The examples on this page export the hero of a starter project. Make one to follow along:
mode8 init my-game --template platformer
cd my-gameExport a sprite#
Point mode8 export at the frames, and at the asset's sidecar for the timing:
$ mode8 export assets/hero/frames --out-dir exports/hero --name hero --animations assets/hero/master.m8.json
✓ Exported hero (15 frames) → exports/hero/
atlas, godot, gif · 9 files
animations attack, hurt, idle, jump, walk
preview exports/hero/hero.gif + one GIF per animation (5)
Godot exports/hero/hero.tres
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/heroWithout --formats you get the three core formats:
| Format | Files | What it is |
|---|---|---|
atlas | hero_atlas.png, hero_atlas.json | Every frame packed into one PNG, and JSON with each frame's rectangle, its duration and the animations |
godot | hero.tres | A Godot 4 SpriteFrames resource over the atlas, one animation per name, crisp in any project |
gif | hero.gif, hero_<animation>.gif | A preview of each animation at its own speed, and hero.gif for the idle loop |


The --name is the stem of every file, so exports of several sprites can share one folder.
Choose the formats#
--formats takes a comma-separated list. Ask for the engine you use; the atlas comes with every engine format:
$ mode8 export assets/hero/frames --out-dir exports/web --name hero --formats pixi,phaser --animations assets/hero/master.m8.json
✓ Exported hero (15 frames) → exports/web/
pixi, phaser · 5 files
animations attack, hurt, idle, jump, walk
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/web| Format | Group | Writes | Page |
|---|---|---|---|
atlas | core | <name>_atlas.png, <name>_atlas.json | this page |
gif | core | <name>.gif, <name>_<animation>.gif | this page |
godot | Godot | <name>.tres (SpriteFrames) | Godot |
godot_scene | Godot | <name>.tscn, mode8_actor.gd | Godot |
normal | Godot | <name>_atlas_n.png, <name>_lit.tres, <name>_lit_frames.tres | Lighting |
emission | Godot | <name>_atlas_e.png, <name>_emission.gdshader, <name>_emission.tres | Lighting |
pixi | engine | <name>_pixi.json | PixiJS |
phaser | engine | <name>_phaser_atlas.json, <name>_phaser_anims.json | Phaser |
love2d | engine | <name>.lua | LÖVE |
unity | engine, experimental | <name>_atlas.png.meta | Unity |
css | engine | <name>.css, <name>_demo.html | Other formats |
indexed | engine | <name>_indexed.png, <name>.hex | Other formats |
mode8 schema --section formats lists the same formats with their stability, for scripts.
Animation timing#
Each animation has its own speed (fps) and either loops or plays once. Every export format carries that timing, so it has to come from somewhere. Mode 8 looks in this order:
--animations FILE. A project asset's sidecar (assets/<name>/master.m8.json) holds the timing the Studio and the rig recorded. A plain JSON file of{"walk": {"frames": [...], "fps": 8, "loop": true}}works too.- A timing sidecar next to the frames.
mode8 animwrites<prefix>.anim.jsonbeside its frames, andexportreads it on its own. - The frame names.
walk_0towalk_3becomewalk,windupandattackbecome oneattack,idleplays at half speed, and one-shot poses such asjump,attackandhurtdo not loop.--fps(default 8) sets the speed of every animation found this way.
The rig's attack runs at 10 fps. Without the sidecar, the names alone give it the default 8 fps:
$ mode8 export assets/hero/frames --out-dir exports/guessed --name hero --formats atlas
✓ Exported hero (15 frames) → exports/guessed/
atlas · 2 files
animations attack, hurt, idle, jump, walk
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/guessed
$ sed -n '/"animations"/,/"hurt"/p' exports/guessed/hero_atlas.json
"animations": {
"attack": {
"frames": [
"windup",
"attack",
"recover"
],
"fps": 8,
"loop": false
},
"hurt": {The animations key of hero_atlas.json (and of the --json report) shows the timing every format used.
Frames straight from mode8 anim#
mode8 anim names its frames <prefix>_<frame>.png, and the prefix defaults to the master's file name. Give it the sprite's name, so the export's animations are called walk rather than master_walk:
$ mode8 anim assets/hero/master.png --rig humanoid --out-dir frames/hero --prefix hero
✓ Animated 15 frames → frames/hero/
idle 4, walk 6, jump 1, attack 3, hurt 1 rig humanoid
Next:
mode8 export frames/hero --out-dir exports/hero --name hero
mode8 verify --assets-dir frames/hero --check-anim --include-root
$ mode8 export frames/hero --out-dir exports/from-anim --name hero
✓ Exported hero (15 frames) → exports/from-anim/
atlas, godot, gif · 9 files
animations idle, walk, jump, attack, hurt
preview exports/from-anim/hero.gif + one GIF per animation (5)
Godot exports/from-anim/hero.tres
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/from-animThe export strips the hero_ from each file name and finds hero.anim.json by itself, so the attack keeps its 10 fps with no --animations.
Preview GIFs#
hero_<animation>.gif plays one animation at its own speed and hero.gif repeats the idle loop (else the first looping animation). Two options shape them:
--gif-scale Nenlarges every pixel N times (1 to 16, default 4).--gif-transparentkeeps the sprite's transparency; by default the GIF has a solid backdrop, which reads better in chat apps and issue trackers.
$ mode8 export assets/hero/frames --out-dir exports/previews --name hero --formats gif --gif-scale 2 --gif-transparent --animations assets/hero/master.m8.json
✓ Exported hero (15 frames) → exports/previews/
gif · 6 files
animations attack, hurt, idle, jump, walk
preview exports/previews/hero.gif + one GIF per animation (5)
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir exports/previewsThe atlas JSON#
hero_atlas.json uses the TexturePacker "JSON hash" layout, which most engines and tools read, with three additions: each frame's duration in milliseconds, an animations map with the timing, and Aseprite-style meta.frameTags, one per animation. Frames are packed animation by animation, so each animation is one run of frames:
$ head -24 exports/hero/hero_atlas.json
{
"frames": {
"windup": {
"frame": {
"x": 1,
"y": 1,
"w": 64,
"h": 72
},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {Show 12 more lines
"x": 0,
"y": 0,
"w": 64,
"h": 72
},
"sourceSize": {
"w": 64,
"h": 72
},
"duration": 250
},
"attack": {--padding PX sets the transparent gap around each frame (0 to 64, default 1). The gap keeps neighbors from bleeding in when an engine filters or scales the texture.
The pivot#
Every format shares one pivot: the point between the feet of the idle frame (else the first frame), measured on the art. Godot scenes offset the sprite by it, PixiJS and Phaser frames carry it as an anchor, Unity as a custom pivot, LÖVE as pivot. Frames are never trimmed, so a character stands on the same spot in every frame and every engine.
Export a project asset again#
After you paint on the hero in the Studio, or run its rig again, export it the same way. The command the starter suggests writes straight into its Godot project:
$ mode8 export assets/hero/frames --out-dir godot/art/hero --name hero --formats godot,godot_scene --animations assets/hero/master.m8.json
✓ Exported hero (15 frames) → godot/art/hero/
godot, godot_scene · 4 files
animations attack, hurt, idle, jump, walk
Godot godot/art/hero/hero.tres
scene godot/art/hero/hero.tscn (CharacterBody2D, mode8_actor.gd)
palette nes_master_gothic from mode8.toml
Next:
mode8 verify --assets-dir godot/art/heroExporting overwrites the files it writes and nothing else, so it is safe to run as often as you like. mode8 verify --assets-dir godot/art/hero checks the result; see Checks.
Pitfalls#
- Wrong animation names. If the animations come out as
master_walk, the frames carry a prefix the export did not strip. Use the same--nameas the frames' prefix, ormode8 anim --prefix. - One frame per animation. A folder of loose PNGs with no numbering and no timing gives one animation per file. Name walk frames
walk_0,walk_1and so on, or pass--animations. - The export folder is not the source. Edit the frames or the project asset, then export again. An edit to
hero_atlas.pngis lost on the next export.
Next#
- Godot:
SpriteFrames, a playable scene with gameplay boxes, TileSets and themes. - Lighting: normal and emission maps for 2D lights.
- Checks: lint the frames and verify the export.
- Export formats reference: every file and key.