Sprite Sheet Splitter
Published Updated
Slice one sprite sheet into numbered PNG frames, by a count of columns and rows or by an exact frame size, with margins and spacing. Up to 500 frames come back in a ZIP, but a width that does not divide evenly blurs the frame edges.
Two ways to say where the frames are
Count mode divides the usable area, which is the image minus margins, by your columns and rows after removing spacing. Size mode works the other way: it fits as many whole frames of your size as it can. A 100-pixel-wide sheet with 32-pixel frames gives 3 columns, and the last 4 pixels are left out.
Both modes stop at 500 frames, and the grid is recalculated as you type, so the final count is known before you slice.
Exact versus fractional frames
A 100 x 100 sheet with three flat-colour columns, red then green then blue, was sliced in Google Chrome 156 with the page's own drawing call:
| Mode | Frame width | Edge pixel colour |
|---|---|---|
| Count, 3 columns | 33.33 | Frame 1 last column: orange (171, 84, 0), a red and green mix |
| Count, 3 columns | 33.33 | Frame 2 last column: (0, 87, 168), a green and blue mix |
| Size, 33 px frames | 33 | Frame 2 first and last column: pure green (0, 255, 0) |
The fix is an exact size. Pad or crop the sheet to a multiple of the frame width, or choose size mode and type an integer.
Cutting a sheet
Step 1
Open the sheet
One PNG, JPG or WebP sheet. A grid preview is drawn over it, and the frame count appears as you change the numbers.
Step 2
Define the grid
Choose columns and rows, or an exact frame width and height. Add margin for an outer border and spacing for gaps between frames.
Step 3
Slice and download
Press Slice & Download ZIP. The archive is sprite-frames.zip, with frame-001.png and onward.
Using the frames
- Engines with a grid setting. In Godot, a clean grid sheet can be sliced in the Inspector by Hframes and Vframes, so cutting files is optional there.
- Output format. Every frame is a PNG, sized to the rounded frame width and height, in a ZIP compressed by the browser.
- Going back. To rebuild a sheet after editing, use Sprite Sheet Packer.
Do the frames match the sheet? Measured in four engines
We ran the splitter's grid arithmetic and its drawing call (copied from the component, which does not export them) in Chrome 156, Chromium 153.0.8010.12 (the build that ships with Playwright, headless, not Google Chrome), Firefox 155.0 and Playwright's WebKit build (user agent Version/26.6, not the Safari app). The sheets were generated pixel art in four colors with transparent gaps; each frame was compared with its region of the sheet, pixel by pixel.
| Test sheet | Mode | Frames | Frames with a differing pixel |
|---|---|---|---|
| 64 x 48, 4 x 3 frames of 16 x 16, no margin | Count and Size | 12 | 0 in both modes, all four engines |
| 78 x 60, 4 x 3 frames of 16 x 16, margin 4, spacing 2 | Count and Size | 12 | 0 in both modes, all four engines |
| 91 x 29, 5 x 2 frames of 17 x 13, margin 1, spacing 1 | Count and Size | 10 | 0 in both modes, all four engines |
When the frame width divides the sheet into whole pixels, every frame was identical to the sheet region in all four engines, and the margin and spacing fields cut the frames out of the same places in both modes.
When the frame is a fraction of a pixel
A 100 x 100 sheet with a red band (columns 0 to 33), a green band (34 to 66) and a blue band (67 to 99) was cut in Count mode into 3 columns of 33.33 pixels. Every frame came out 33 x 100, and the cut edge was blended in frames 2 and 3. The first column of frame 2 held a mix of red and green, which was (168, 87, 0) in Chrome 156, (175, 79, 0) in Chromium 153 and Firefox 155, and (169, 86, 0) in the WebKit build. The first column of frame 3 held a mix of green and blue: (0, 84, 171) in Chrome 156 and WebKit, (0, 95, 159) in Chromium 153 and Firefox. The same sheet cut in Size mode with a 33-pixel frame cut on whole pixels and every edge column of the three frames was a pure color of the sheet in all four engines.
The browsers blend the fractional edge in slightly different ways, so the mixed colors differ by engine. If the exact pixels matter, use Size mode with a whole number, or resize the sheet to a multiple of the frame size first.
Limits, messages and speed
The grid is checked as you type. A 25 x 20 grid (500 frames) was accepted and 501 frames gave the message That would produce 501 frames, please use 500 or fewer. In Size mode a 1,002 x 2 sheet with frames of 2 x 1 gave the same message for 1,002 frames. Margins wider than the sheet gave Margins are larger than the image itself, a spacing too large for the columns gave Spacing is too large for this many columns/rows to fit, and a frame bigger than the sheet gave The frame size is larger than the available image area. A column count of 0 was treated as 1, and 2.9 columns as 2.
For speed we cut a 1,280 x 1,280 sheet of random four-color pixels into 400 frames of 64 x 64 in one run per engine. Cutting and encoding the 400 PNG frames took 45 ms in Firefox 155, 410 ms in Chromium 153, 427 ms in the WebKit build and 631 ms in Chrome 156. Building the ZIP took 159 to 299 ms. The ZIP files were 1,659,858 bytes (Chrome and Chromium), 1,194,498 bytes (Firefox) and 1,714,709 bytes (WebKit), about 2 to 4 percent more than the 400 frame files added up. We used random noise, and we did not test ordinary artwork.
Encoding the frames one by one or several at once
Each frame is drawn on its own canvas and saved as a PNG with the browser's canvas encoder. We timed that step on the same 400-frame sheet in Chrome 156, Chromium 153, Firefox 155 and the WebKit build, one run each, with the frames encoded one after another and with several encodings waiting at once:
| How the 400 PNGs were made | Chrome 156 | Chromium 153 | Firefox 155 | WebKit build |
|---|---|---|---|---|
| One after another | 6,522 ms | 6,362 ms | 112 ms | 485 ms |
| Up to 8 at once | 828 ms | 832 ms | 35 ms | 445 ms |
| Up to 16 at once | 500 ms | 416 ms | 31 ms | 408 ms |
| All 400 at once | 465 ms | 108 ms | 34 ms | 385 ms |
One after another, Chrome 156 and Chromium 153 spent about 16 ms on each 64 x 64 frame, while Firefox needed well under 1 ms. With several encodings waiting at once that gap mostly closed, and every variant gave the same PNG bytes as the one-after-another loop in each engine. The splitter keeps up to 16 encodings waiting at once, fewer for large frames so that only about 16 megapixels of frame canvases exist together: frames of 2,048 x 2,048 go three at a time.
In the tool's own run on the same sheet, all 400 frames matched the one-after-another files byte for byte in all four engines, and the one-after-another loop took 6,667 ms in Chrome 156 against 631 ms for the tool. For a few large frames there was no gain: four frames of 1,024 x 1,024 took 156 ms against 135 ms one after another in Chrome 156, and three of 2,048 x 2,048 took 361 ms against 246 ms. Waiting on several encodings at once does not change the frame files or the ZIP size.
Sprite sheet splitting questions
Count or size: which grid mode should I use?
Use size when you know the frame, for example 64 x 64. Use count when the sheet is a clean grid. In size mode the tool counts how many whole frames fit, and a remainder at the right or bottom is dropped.
Why are the edges of some frames slightly mixed in colour?
In count mode a sheet 100 pixels wide cut into 3 columns gives frames of 33.33 pixels, and the browser blends across the fractional edge. The last pixel column of frame 1 showed orange from a red and green sheet. Integer widths are exact.
In what order are the frames numbered?
Row by row, left to right, starting at frame-001.png. The number always has at least three digits, which is enough for the 500-frame limit.
What are margin and spacing for?
Margin is the border around the whole grid, taken from the left and right or the top and bottom. Spacing is the gap between neighbouring frames, for sheets exported with gutters.
Does it keep transparency?
Yes. Each frame is drawn onto a clear canvas and written as PNG, so the transparent parts of a PNG or WebP sheet stay transparent in every frame.
Is the sheet uploaded?
No. The sheet is cut on canvases inside the page and zipped there, and no request carries it.
Are the frames identical to the sheet?
In our test, yes when the frame size is a whole number of pixels: 34 frames from three generated sheets, with margins and spacing, had no differing pixel in Chrome 156, Chromium 153, Firefox 155 and the WebKit build.
Why are the edges of my frames a mix of two colors?
Count mode divides the sheet into frames that may be fractions of a pixel wide. A 100-pixel sheet cut into 3 columns gave blended edge columns, and the blend differed between engines. Size mode with a whole number gave pure colors.
How long does a sheet of 400 frames take?
400 frames of 64 x 64 took 0.41 to 0.63 seconds to cut and encode in Chrome 156, Chromium 153 and the WebKit build, and 0.05 seconds in Firefox 155, one run each, with noisy test pixels. Building the ZIP added 0.16 to 0.30 seconds.
What does a column count of 0 do?
It is treated as 1, and a fraction is rounded down: 2.9 columns gave 2.
Why is Chrome slower than Firefox when frames are made one by one?
Waiting, not work. Chrome 156 and Chromium 153 returned each small PNG about 16 ms after it was asked for, so 400 frames made one after another took about 6.7 seconds there and 0.09 seconds in Firefox 155. The tool asks for up to 16 frames at a time, which took 0.63 seconds in Chrome 156 and gave the same PNG files.