Sprite Sheet Generator
Pack PNG, GIF frames, SVG or a whole folder into one sprite sheet with trim, extrude and identical-frame merging. PNG or WebP and Phaser/PixiJS JSON. No upload.
- Runs in your browser
- Tool input is not uploaded to ZeroTool servers
- Free · No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
Example: A Walk Cycle With a Repeated Pose
Four 64 × 64 frames, where frame 4 repeats the pose of frame 2. With the default options (Packed, Trim on, Spacing 2, Pack identical images once on) the sheet is 95 × 45 px and the info line reads 4 sprites, 3 unique. walk_01.png is stored as a 30 × 44 frame at x 33:
"walk_01.png": {
"frame": { "x": 33, "y": 0, "w": 30, "h": 44 },
"rotated": false,
"trimmed": true,
"spriteSourceSize": { "x": 17, "y": 10, "w": 30, "h": 44 },
"sourceSize": { "w": 64, "h": 64 }
}
walk_02.png and walk_04.png both point at { "x": 0, "y": 0, "w": 31, "h": 45 }. Because the four names differ only in a trailing number, the JSON Hash also gets "animations": { "walk": [ ... ] }, the field PixiJS reads into sheet.animations.walk.
What Phaser and PixiJS Read
The JSON and XML from this tool were parsed with the engines' own parsers (Phaser 3.90.0 and 4.2.1 JSONHash, JSONArray and AtlasXML, PixiJS 8.22.0 Spritesheet), and the results are checked on every change to the tool:
| Export | Phaser 4.2.1 | Phaser 3.90.0 | PixiJS 8.22.0 |
|---|---|---|---|
| JSON Hash | Frames by name, trim offset kept | Same | Textures by name, plus animations |
| JSON Array | Same as JSON Hash | Same | Textures keyed "0", "1" and so on, not by name |
| XML, trimmed frames | Original size kept | Original size read as the trimmed size | No XML loader |
The Phaser 3 row is Phaser issue #7245: AtlasXML passes the trimmed width as the original width, so walk_01.png gets a real width of 30 instead of 64, and a sprite with a non-default origin shifts. The fix shipped in Phaser 4.0.0. The tool shows this warning when you pick XML with trimmed frames; on Phaser 3, use JSON Hash or turn off Trim.
// Phaser 3 or 4
this.load.atlas('hero', 'assets/walk.png', 'assets/walk.json');
this.add.sprite(200, 300, 'hero', 'walk_01.png');
// PixiJS 8
const sheet = await Assets.load('assets/walk.json');
const walk = new AnimatedSprite(sheet.animations.walk);
GIF to Sprite Sheet
Animated GIFs are split into frames with the same decoder as the GIF Splitter, including disposal and transparency, so each frame looks the way the browser plays it. Frames are named coin-frame-001.png, coin-frame-002.png and so on, then trimmed and packed like any other image. A coin that only moves inside its canvas often trims to the same pixels in every frame; those frames then share one rectangle and keep their own offsets.
Grid Sheets for load.spritesheet
Grid places every image in a cell the size of the largest one, row by row. Ten 32 × 32 coins with 4 columns and Spacing 2 give a 134 × 100 px sheet. Phaser's this.load.spritesheet reads no data file and counts 4 × 3 = 12 frames, so pass endFrame: 9. With Power of two on, the same sheet is 256 × 128 and Phaser counts more empty frames, so leave it off for this loader. With Extrude E, pass margin + E and spacing + 2 × E.
Stopping Texture Bleeding
When a sprite is scaled, rotated or drawn at a fractional position, bilinear filtering mixes in the texels around each frame. Spacing (2 px by default) puts transparent pixels between frames, Extrude repeats each frame's edge pixels 1 to 8 px outward for tiles that touch, and Margin keeps frames away from the sheet border. Pixel art drawn with nearest-neighbor filtering at whole pixels can use 0 for all three.
Keep phones in mind when you pick Max width. In Web3D Survey (read 2026-10-28), every Android report allows a WebGL2 texture of 4,096 px per side, but only 75% allow 8,192. The tool warns when a side goes above 4,096 px.
How It Compares
Tested on 2026-10-02 with the same files (four 64 × 64 PNG frames with one repeated pose, a 4-frame GIF and an SVG). Neither tool uploaded the images.
- CodeAndWeb Free Sprite Sheet Packer, from the makers of TexturePacker: Phaser, PixiJS, CSS and LESS data, 1 px padding. It did not trim (the page lists trim as a TexturePacker Pro feature), packed the repeated pose twice, added the GIF as one frame and left the SVG out without a message.
- free-tex-packer.org 0.6.7: trims, detects identical images and offers many formats, but rotation is on by default (CSS and some loaders cannot draw rotated frames), padding is 0, the GIF gave one frame, SVG and WebP are not accepted, and our set came out as a 30 × 140 single column.
This tool adds every GIF frame, SVG at a chosen scale, folders with sub-folder names, WebP output and the engine checks above. It does not rotate frames or write several pages.
Limits
- Up to 1,000 images, each up to 8,192 px per side; the sheet up to 16,384 px per side and 16,777,216 pixels in total. WebP stops at 16,383 px per side.
- WebP is lossless in Chrome and Edge (they encode quality 1.0 as lossless). Safari cannot encode WebP, so the option is disabled there.
- Browsers keep canvas pixels with premultiplied alpha. A pixel
rgb(200, 100, 50)at alpha 1 came out asrgb(255, 0, 0)at alpha 1 in a PNG exported from Chrome 152; at alpha 128 it came out asrgb(199, 100, 50). Fully opaque pixels are unchanged. - Animated WebP and APNG add their first frame only; split them first.
- SVG is drawn as an image, so scripts and external files inside it do not load. Sizes in mm, pt or em are converted like Chrome does; an SVG with neither a size nor a viewBox is skipped.
- No rotation, no multipack, no Cocos
.plist, Unity or Godot atlas files.
Related Tools
- GIF Splitter — preview and pick GIF frames before packing.
- Image Splitter — cut a finished sheet back into tiles.
- SVG to PNG Converter — rasterize icons at an exact size.
- Image Compressor — shrink the exported sheet.
FAQ
How do I load the sheet in Phaser or PixiJS?
Download the image and the JSON Hash file into the same folder. In Phaser 3 or 4, call this.load.atlas(key, imageURL, jsonURL) in preload and use the frame name, for example this.add.image(x, y, key, 'walk_01.png'). In PixiJS 8, await Assets.load on the JSON URL; it loads the image named in meta.image and returns a Spritesheet, so new Sprite(sheet.textures['walk_01.png']) and new AnimatedSprite(sheet.animations.walk) work.
Can I turn an animated GIF into a sprite sheet?
Yes. Drop the GIF and every frame is added, composited the way a browser plays it and named like the GIF Splitter names its files (coin-frame-001.png, coin-frame-002.png and so on). Turn off Add every frame of animated GIFs to add only the first frame. A GIF whose canvas area times its frame count is over 50,000,000 pixels, or that has more than 1,000 frames, adds its first frame only.
Why do some frames share one rectangle?
In the Packed layout, Pack identical images once is on by default. When two images have the same pixels (compared after trimming when Trim transparent edges is on), the tool draws them once and gives both frame names the same frame rectangle; each keeps its own spriteSourceSize offset, and the info line shows N sprites, M unique. Walk cycles often repeat a pose, so this saves space. The Grid layout never merges images. Turn the option off if your code edits frames one by one.
Are my images uploaded?
No. Decoding, trimming, packing and PNG or WebP encoding run in your browser, and the images are not sent to a server. Only the option settings, including the sheet name, are saved, in this browser's local storage; Ctrl/⌘+L keeps them, and clearing this site's data in the browser removes them. Images, previews and exported text are not saved. The page loads Google Analytics and AdSense like other tool pages. Its usage events hold only the tool name and the action: png or webp when you download the sheet, data when you download the data file, and copy when you copy the data.
What are the limits?
Up to 1,000 images, each up to 8,192 px per side, and a sheet up to 16,384 px per side and 16,777,216 pixels in total (WebP: 16,383 px per side). Frames are never rotated, the output is one sheet, and the data formats are JSON Hash, JSON Array, Sparrow XML and CSS. For rotation, several pages, or Cocos and Godot atlases, use TexturePacker or free-tex-packer. For Unity, use TexturePacker or Unity's Sprite Atlas.