Skip to main content
The PixiJS format writes atlas metadata in JSON Hash layout, which is what PixiJS expects. There is no structural difference from the standard json_hash output. It exists as a named alias so project files can be explicit about which engine they target.

Usage

fastpack pack sprites/ --data-format pixijs

Output format

Output is identical to JSON Hash. See the JSON Hash documentation for the complete schema.
{
  "frames": {
    "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 }
    }
  },
  "meta": {
    "app": "FastPack",
    "version": "1.0",
    "image": "atlas.png",
    "format": "RGBA8888",
    "size": { "w": 256, "h": 128 },
    "scale": "1"
  }
}

Loading in PixiJS

PixiJS v7+

await PIXI.Assets.load('atlas.json');
const sprite = PIXI.Sprite.from('player/idle');

PixiJS v6 and earlier

PIXI.Loader.shared.add('atlas', 'atlas.json').load(() => {
  const sprite = new PIXI.Sprite(PIXI.Texture.from('player/idle'));
});

Implementation details

The PixiJS exporter delegates directly to JsonHashExporter. Choosing pixijs vs json_hash produces byte-identical output; the distinction is purely for clarity in project files.
PixiJS expects sprite IDs as the frame keys, which is exactly what FastPack writes. Sprite IDs use forward slashes as path separators on all platforms.

TexturePacker compatibility

TexturePacker’s PixiJS preset also outputs JSON Hash. Output from FastPack loads without modification in PixiJS projects previously built with TexturePacker.

Schema reference

For complete schema documentation including all frame fields and metadata, see the JSON Hash format reference. Key points for PixiJS:
  • Frame keys are sprite IDs (path without extension)
  • frame contains the atlas texture coordinates
  • rotated indicates 90° clockwise rotation
  • trimmed indicates transparent border removal
  • spriteSourceSize provides offset for reconstruction
  • sourceSize contains original untrimmed dimensions

Build docs developers (and LLMs) love