Skip to main content
The JSON Array format writes atlas metadata in the same structure as JSON Hash, but frames is a JSON array rather than an object. Each entry carries a filename field holding the sprite ID instead of using the sprite ID as an object key. Use this format when your runtime iterates frames in order, or when a flat array is more convenient than a keyed object.

Usage

fastpack pack sprites/ --data-format json-array

Output format

Output for a two-sprite atlas:
{
  "frames": [
    {
      "filename": "player/idle",
      "frame": { "x": 2, "y": 2, "w": 64, "h": 96 },
      "rotated": false,
      "trimmed": true,
      "spriteSourceSize": { "x": 4, "y": 0, "w": 64, "h": 96 },
      "sourceSize": { "w": 72, "h": 96 }
    },
    {
      "filename": "ui/button",
      "frame": { "x": 68, "y": 2, "w": 48, "h": 32 },
      "rotated": false,
      "trimmed": false,
      "spriteSourceSize": { "x": 0, "y": 0, "w": 48, "h": 32 },
      "sourceSize": { "w": 48, "h": 32 }
    }
  ],
  "meta": {
    "app": "FastPack",
    "version": "1.0",
    "image": "atlas.png",
    "format": "RGBA8888",
    "size": { "w": 256, "h": 128 },
    "scale": "1"
  }
}

With alias detection

When alias detection is on, duplicate sprites carry an aliasOf field pointing at the original sprite’s ID. The frame rect is still valid — it points to the same atlas region.
{
  "filename": "enemies/goblin",
  "frame": { "x": 2, "y": 2, "w": 32, "h": 32 },
  "rotated": false,
  "trimmed": false,
  "spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
  "sourceSize": { "w": 32, "h": 32 },
  "aliasOf": "enemies/orc"
}

Schema reference

Frame object

filename
string
required
Sprite ID (source path relative to sprite root, without extension)
frame
object
required
Rectangle in the atlas texture
x
number
X position in pixels
y
number
Y position in pixels
w
number
Width in pixels
h
number
Height in pixels
rotated
boolean
required
true when the sprite was rotated 90° clockwise to fit
trimmed
boolean
required
true when the sprite was packed with trim mode enabled
spriteSourceSize
object
required
Frame’s position and size relative to the original source image
x
number
X offset from original image
y
number
Y offset from original image
w
number
Width in pixels
h
number
Height in pixels
sourceSize
object
required
Full original image dimensions before any trimming
w
number
Original width in pixels
h
number
Original height in pixels
aliasOf
string
Points to the original sprite’s ID for pixel-identical duplicates (when alias detection is enabled)

Meta object

meta
object
required
Atlas metadata
app
string
Always "FastPack"
version
string
Format version ("1.0")
image
string
Texture filename
format
string
Pixel format (e.g., "RGBA8888")
size
object
Atlas dimensions
scale
string
Scale factor used during packing

TexturePacker compatibility

Matches TexturePacker’s JSON Array output. Engines using JSON Hash object-key lookup will not load this format — pick the right variant for your runtime loader.
Array order matches atlas packing order (largest-area-first). The order is stable across runs on the same input set.

Technical notes

All field semantics — frame, rotated, trimmed, spriteSourceSize, sourceSize — match the JSON Hash format. See the JSON Hash documentation for detailed field-level descriptions.

Build docs developers (and LLMs) love