Skip to content

Defold Atlas Export — .atlas and .tilesource from Frames

Defold builds atlases itself from individual images, so a pre-packed sheet has to be split back into frames. This export writes those frame images, an .atlas with one animation group per tag and a .tilesource for the grid.

A Defold .atlas is not a packed image: it lists separate image files and animation groups, and Defold packs them itself when the project builds. A sheet you already have therefore has to go back to one PNG per frame. Nerulio writes those frame PNGs (full canvas, so frames stay aligned), an .atlas with one animation group per tag and a .tilesource with the same animations on a grid, all in one folder, /assets/run/ for frames named run. Defold's builder bob.jar 1.13.1 built both and the built texture was read back; the editor and a running game were not used.

Drop frame images, a GIF or an .aseprite file to pack
Runs in your browser. Files are not uploaded.
Studio Pack & Export: the packed atlas page with every frame outlined, the used area and the export targets
The real Studio with a CC0 asset (OpenGameArt).
Exports to
  • DefoldBuilt· Defold bob.jar 1.13.1
  • Godot 4Verified· Godot 4.7.2
  • Unity 6Verified· Unity 6000.5.3f1
  • Phaser 3 / 4Verified· Phaser 3.90 + 4.2
  • PixiJS 8Verified· PixiJS 8.21
  • Aseprite JSONVerified· Phaser load.aseprite · PixiJS 8.21
  • .asepriteVerified· Aseprite 1.3.18
  • Spine / libGDXVerified· spine-canvas 4.2
  • Starling / Sparrow XMLVerified· Phaser 4.2
  • LÖVEVerified· LÖVE 11.5
  • GameMakerUNVERIFIED
  • CSS spritesVerified· Chromium
  • GIF / APNGDecoded· Pillow

How Defold turns images into an animation

An atlas resource is a list of images plus animation groups. Each group has an Id, a playback mode such as Loop Forward or Once Ping Pong, and one Fps; its images play in the listed order. At build time Defold packs every image into texture pages, and the atlas properties Margin, Inner Padding and Extrude Borders control spacing and the repeated edge pixels.

A tile source instead cuts one image into equal tiles, numbered from 1 at the top left, left to right and row by row. An animation there is a run of adjacent tiles from Start Tile to End Tile, again with a playback mode and an fps.

A Sprite component takes an atlas or a tile source as its Image and plays one animation: its Default Animation, or the one a script starts with sprite.play_flipbook. There is no per-frame duration: every frame of a group lasts 1 ÷ fps seconds.

Animation group
A named list of images in an atlas, with a playback mode and an fps.
Extrude Borders
How many times the edge pixels are repeated around each image; Nerulio's .atlas sets 2.
Tile source
One grid image with tile size, margin, spacing and tile-range animations.
Playback
PLAYBACK_LOOP_FORWARD, PLAYBACK_ONCE_PINGPONG and so on, as written in the file.

Example: the six-frame run as a Defold bundle

input: 6 frames of 40 × 29, tag "run" at 10 fps, looping

assets/run/frames/run_0.png … run_5.png   6 images, 40 × 29 each (trim off)
assets/run/run.atlas
  images { image: "/assets/run/frames/run_0.png"  sprite_trim_mode: SPRITE_TRIM_MODE_OFF } …
  animations { id: "run"  images {…} × 6  playback: PLAYBACK_LOOP_FORWARD  fps: 10 }
  margin: 0   extrude_borders: 2   inner_padding: 0
assets/run/run.tilesource
  image: "/assets/run/run_tiles.png"   3 × 2 tiles = 120 × 58 px
  tile_width: 40   tile_height: 29
  animations { id: "run"  start_tile: 1  end_tile: 6  playback: PLAYBACK_LOOP_FORWARD  fps: 10 }

one frame = 1 / 10 fps = 100 ms; one cycle of 6 frames = 0.6 s

Mixed durations cannot be kept: frames of 100, 100 and 150 ms play at the group's single fps, and the export notes say so. A reverse tag is written as reversed image order with forward playback; a ping-pong tag uses Defold's own ping-pong mode.

What it does

  • .atlas listing full-canvas frame images, with one animation group per animation.
  • .tilesource for grid-based sheets, under assets/<name>/.
  • Checked by Defold's command-line builder bob.jar 1.13.1; the built texture set's UVs were read back.
  • One fps per animation (Defold animation groups have no per-frame duration).

How to do it

  1. Drop a sheet (and Apply), numbered frames, a GIF or an .aseprite file.
  2. Name the animations on the timeline.
  3. In Pack & Export choose Defold.
  4. Copy the defold/ folder into your project and add the atlas to a sprite component.

Files you get

FileWhat it is for
frames/run_0.png …One full-canvas PNG per frame (trim off, so every frame keeps its place).
run.atlasThe frame images plus one animation group per tag (playback, fps) and extrude_borders: 2.
run_tiles.png, run.tilesourceThe same frames on one grid with a shared pivot, and the animations as tile ranges.
README-DEFOLD.mdWhere the folder must go and how to pick an animation.

Use it in Defold

  1. Copy the exported folder into the project so that it sits at /assets/run/: the paths inside the .atlas and .tilesource start with that prefix. If you put it elsewhere, search and replace the prefix in both files.
  2. Add a Sprite component to a game object, set its Image to run.atlas (or run.tilesource) and its Default Animation to run.
  3. From a script, switch animations with sprite.play_flipbook("#sprite", "run"); an optional third argument is a function called when a non-looping animation has finished.
  4. For pixel art, set Default Texture Min Filter and Default Texture Mag Filter in the Graphics section of game.project to nearest filtering.
  5. Build the project: Defold packs the frame images into its own texture pages at this point, so Nerulio's page layout does not matter for this target.

Check the result

  • Open run.atlas in the editor: the run group lists six images in order.
  • Run the game: run repeats every 0.6 s (six frames at 10 fps).
  • Frames do not shift while playing, because every frame image is the full 40 × 29 canvas.

Troubleshooting

SymptomLikely causeHow to checkFix
Build error about an image that is not foundThe folder is not at /assets/run/, so the absolute paths in the .atlas point nowhereOpen the .atlas as text and compare the paths with where the files areMove the folder, or replace the /assets/run/ prefix in both files
Frames with different durations all play at one speedA Defold animation group has one fpsThe export notes; fps: in the groupSplit the tag into groups with their own fps, or even out the durations in the Studio
A fractional frame rate became a whole numberDefold stores fps as an integer, so 7.5 fps is roundedThe export notes say fractional fps were roundedChoose durations that give a whole fps: 125 ms → 8 fps, 100 ms → 10 fps
Pixel art looks blurryLinear texture filteringThe Graphics filters in game.project, or the sprite material's samplerSwitch both filters to nearest
Edges pick up neighbouring pixels when the sprite is scaledToo little padding in Defold's own packing for the filter usedextrude_borders and inner_padding in the .atlasRaise Extrude Borders or Inner Padding in the atlas properties

Other ways to do it

OptionWhen it is the better choice
Your own frame PNGs in a new atlas in the Defold editorYou already have the frames as separate files: this is Defold's native route and needs no export. If you only have a sheet, split it into PNG frames first.
A tile source pointed at the original sheetThe sheet is a clean grid of equal cells: set tile width, height, margin and spacing and define the animations as tile ranges yourself.

Engine exports and how each was checked

"Verified" means the exported files were loaded by the real engine or tool on real CC0 assets and the result was compared with the source. Anything that was not loaded is labelled as such.

TargetFilesCheck
Godot 4.tres SpriteFrames · .tscn AnimatedSprite2D · .png.importVerified Godot 4.7.2Loaded by Godot; every animation frame drawn and compared with the source file. The scene uses Nearest filtering; rotation is never used.
Unity 6.unity.json · Editor/NerulioSpriteImporter.cs · AnimationClipVerified Unity 6000.5.3f1Batch mode: sprite rects, pivots, pixels, clip keys and durations checked.
Phaser 3 / 4atlas JSON (multiatlas) · .anims.jsonVerified Phaser 3.90 + 4.2Frames and animations drawn by both versions.
PixiJS 8spritesheet JSON · animations · anchor · meta.scaleVerified PixiJS 8.21Rotated and multi-page atlases included.
Aseprite JSONhash / array · frameTags · slicesVerified Phaser load.aseprite · PixiJS 8.21Tags keep their direction and repeat count.
.asepritelayers · tags · durations · slicesVerified Aseprite 1.3.18Opened and rendered by the Aseprite command line.
Spine / libGDX.atlasVerified spine-canvas 4.2Every region drawn by the Spine runtime, rotated and trimmed; libGDX itself was not run.
Starling / Sparrow XMLXML per pageVerified Phaser 4.2Phaser 3.90 draws trimmed XML frames wrongly (its own bug); the "Sparrow XML (Phaser 3)" preset turns trim off and passes in 3.90 and 4.2.
LÖVELua quads · nerulio_atlas.lua · main.luaVerified LÖVE 11.5Every frame drawn and every animation stepped through the shipped helper.
Defold.atlas · .tilesourceBuilt Defold bob.jar 1.13.1Built by Defold's command-line builder; the built texture's UVs were read back.
GameMakerspr_<name>_stripN.png · gamemaker.jsonUNVERIFIEDNot loaded in GameMaker (no headless GameMaker). The strips are cut the way its strip importer cuts them.
CSS sprites.css · preview .htmlVerified ChromiumEvery class drawn from the shipped stylesheet.
GIF / APNGone file per animationDecoded PillowEvery frame and delay decoded again after export; APNG is exact.

Evidence

Exports: 49 runs in the real engines on real CC0 assets, 47 pass — the 2 failures are Phaser 3.90's trimmed-XML bug, which the Phaser 3 preset avoids. Packer head-to-head on 5 real frame sets (CodeAndWeb free web packer, GAPTools, free-tex-packer): smallest sheet on all 5 with rotation allowed, 4 of 5 without; every frame restored pixel-exact.

Limits

  • Polygon (mesh) packing is not offered: none of the verified engines draws a mesh atlas from exported data.
  • GameMaker strips are UNVERIFIED in GameMaker itself.
  • Scale variants (@0.5x–@4x) use nearest-neighbour only.
  • Trimmed Starling XML is drawn wrongly by Phaser 3.90; use the "Sparrow XML (Phaser 3)" preset there.

Versions and sources

Built with Defold bob.jar 1.13.1 (Java 25) in a throw-away project with one Sprite component. Animation ids, tile ranges, fps and playback were read from the built texture set, and every frame was cut from the built texture with its UVs and compared with its source. The Defold editor and a running game were not used, so the label is "built", not "verified". Defold terms follow the Defold manuals.

Official documentation used

Questions

Was it run inside the Defold editor?

It was built by Defold's own builder (bob.jar 1.13.1) and the resulting UVs were read back; the editor GUI and a running game were not used, so the label is "Built", not "Verified".

Why one frame rate per animation?

A Defold animation group has a single fps; frames with different durations in the Studio are exported with one rate per group.

Is it free, and do I need an account?

Everything on these pages is free and works without an account. There is no watermark and no export that is held back.

Are my sprites uploaded?

No. The Studio decodes, packs and exports in this browser tab. Projects are autosaved in the browser (IndexedDB) and can be saved as a .nerulio file.

Does it need Aseprite or an engine plugin installed?

No. .aseprite files are read and written in the browser, and each engine bundle carries what that engine needs (for Godot, the import settings and scene; for Unity and the Godot TileSet, a small editor script).