Overview
Thesplit command reverses the packing process by extracting individual sprite images from a packed atlas using its metadata file. This is useful for recovering source sprites, debugging atlases, or converting atlases from other tools.
Basic usage
Examples
Arguments
Path to the packed atlas PNG file. This is the texture file generated by
fastpack pack.Path to the JSON Hash data file produced by fastpack. This file contains sprite coordinates and metadata.
The split command currently only supports the
json-hash data format. If your atlas uses a different format (json-array, phaser3, pixijs), you’ll need to convert the metadata first.Options
Output directory for extracted sprite files. The directory will be created if it doesn’t exist.Short form:
-oOutput
Successful splitting prints:Behavior
Directory structure
Extracted sprites preserve the directory structure from their original sprite IDs:Sprite reconstruction
The split command reconstructs sprites with:- Trimmed regions - If the atlas was packed with trimming, transparent borders are restored
- Rotation - Rotated sprites are automatically un-rotated
- Original dimensions - Sprites are restored to their pre-pack dimensions
- Transparent padding - Border and shape padding is removed
Alias handling
When the atlas contains aliases (deduplicated sprites):- Each alias is extracted as a separate file
- All aliases reference the same pixel data
- The output contains duplicate files for each alias
Use cases
Recover lost sources
If you’ve lost original sprite files but have a packed atlas:Debug packing issues
Verify that packed sprites match your expectations:Convert from other tools
Convert atlases from other texture packers to individual sprites:Extract variant scales
Split different scale variants separately:Limitations
Data format support
Onlyjson-hash format is currently supported. Other formats require conversion:
Lossy information
Some information may be lost during pack/split cycles:- Extrusion - Extruded borders are baked into the atlas and can’t be removed during split
- Texture format - JPEG or WebP compression artifacts remain in split sprites
- Pixel format - Dithering from reduced bit depth is permanent
Metadata requirements
The JSON file must contain:- Frame coordinates (x, y, w, h)
- Source size (original sprite dimensions)
- Rotation flag (if sprites were rotated)
File naming
Extracted sprites use their sprite ID as the filename:- Sprite ID:
characters/player→ File:sprites/characters/player.png - Forward slashes in IDs become directory separators
- All extracted sprites are PNG files regardless of source format
Technical notes
Trimming reconstruction
When splitting trimmed atlases:frame- Position in atlas (trimmed region)sourceSize- Original dimensions before trimmingspriteSourceSize- Offset of trimmed region
Rotation handling
Rotated sprites in the atlas:rotated boolean in the metadata determines whether to rotate back.
Example workflow
See also
- fastpack pack - Create atlases that can be split
- Configuration reference - Understand metadata format
- JSON Hash format - JSON Hash format specification