How to turn a GIF into a sprite sheet
- Load a GIF. Drop it on the box above, paste it, or pick a file. Or try the controls on the built-in sample first; it is already loaded, and its frames deliberately have uneven delays so you can see how timing is handled.
- Set the layout. Choose columns (or leave 0 for a near-square auto grid), then margin, spacing, padding and extrude. The preview rebuilds with every change, and the readout states the sheet size, cell size and rows before you download anything.
- Download the PNG, or the ZIP. The PNG alone is enough for engines that slice by grid. The ZIP adds the data files: TexturePacker JSON (hash and array), a Godot 4 SpriteFrames resource, CSS, and a README with copy-paste load code for Phaser, PixiJS, Unity and Godot, all with your sheet's real numbers filled in.
What each setting actually does
Columns
How many frames sit in each row. Auto (0) uses the square root of the frame count, rounded up, so 8 frames become 3 columns × 3 rows, which keeps the sheet near-square. Engines do not care about the shape; pick what fits your texture budget.
Margin, spacing and padding are three different things
Margin is empty space around the outside of the whole sheet. Spacing is the gap between one cell and the next. Padding is empty space inside a cell, around its frame. Tools that merge these into one "padding" number leave you guessing which gap you actually got; here each one is separate, and the JSON rectangles always describe the frame itself, never the padding.
Extrude: the bleeding fix
When a GPU draws one frame from a sheet, its filtering samples pixels slightly outside the frame's rectangle, and if the neighbouring frame starts right there, its colours leak in as a fringe. That is texture bleeding, and it gets worse with scaling and mipmaps. Extrude repeats the frame's own edge pixels outward by the amount you set, so a stray sample lands on the frame's own colour instead of the neighbour's. The usual advice is to keep about 2 px of protection between a frame's pixels and the next cell: spacing gives you distance, extrude gives you correctness, and 1 px of extrude plus 2 px of spacing (the defaults here) covers most cases. Use 4 px of spacing if your engine generates mipmaps.
Background
Transparent is what game engines expect. A solid colour is there for sheets that will be flattened anyway, and because a GIF frame can itself be partly transparent, the colour also shows you exactly which pixels of the sheet are see-through before you commit.
Frame scale
50% and 25% shrink each frame with nearest-neighbour sampling, with no blur, which is what pixel art needs. The frames get smaller; the animation's timing in the data files does not change. Scale here for a quick size cut, or keep 100% and let your engine scale, where you control the filter.
Frame order
Reverse places the GIF's last frame first. The sheet, the JSON, the Godot file and the CSS all follow the same order, so frame_0001 is always the first frame on the sheet, whichever direction you choose.
Your frames are composited first, and it matters
A GIF rarely stores whole pictures. To save space it stores partial patches (a small rectangle that changed) plus a disposal instruction saying what to do with the previous patch. Players composite those patches into full frames as they go. If a converter lays the raw patches onto a sheet instead, you get fragments: a hand here, a hole there, whatever was underneath missing entirely. This tool decodes and composites every frame exactly the way a player displays it, then lays out the finished pictures, so patch-based GIFs come out whole.
Power-of-two: when it matters and when it doesn't
Some graphics stacks require texture dimensions to be powers of two (128, 256, 512…). In WebGL 1, a non-power-of-two texture cannot use mipmaps or repeat wrapping and is limited to basic filtering; some older GPUs and compressed texture formats have similar rules. WebGL 2 removed the restriction, and Canvas, CSS and modern engines never had it. So: turn power-of-two on if you are targeting WebGL 1 or old hardware and need mipmaps; leave it off otherwise. All it does is pad the canvas with empty space to the next power of two. Your frames keep their positions either way, and the readout tells you when padding was added.
The timing problem, with real numbers
A sprite sheet is a still image. It cannot store how long each frame was shown, so if your GIF's frames have uneven delays, something else has to carry that information, or your engine will play every frame for the same length of time and the animation's rhythm changes. Here is exactly what happens with an 8-frame walk cycle, 64 × 48 px frames, with these delays: 100, 100, 50, 100, 200, 50, 100, 100 ms (800 ms per loop).
With auto columns (3), spacing 2 and extrude 1, each cell is 66 × 50 px and the sheet is 202 × 154 px. In the JSON files, frame 3 sits at x=137, y=1 with "duration": 50, its real 50 ms, not an average. In the Godot file, the animation speed is 10 and the frames get durations 1.0, 1.0, 0.5, 1.0, 2.0, 0.5, 1.0, 1.0, each delay divided by 100, which is how SpriteFrames expresses per-frame timing. Nothing is rounded to a single frame rate.
The CSS is the honest exception: steps() divides the loop into equal slices by design, so the CSS in the ZIP plays this animation at an even 100 ms per frame and says so in its header comment. Use the CSS for a quick web preview; use the JSON or Godot durations when the timing has to be right.
A worked example: the sample built into this page
The GIF already loaded in the tool above is this page's own built-in sample, a bouncing ball: 12 frames of 128 × 96 px, with delays of 100, 50, 50, 100, 200, 100, 50, 50, 100, 100, 200 and 100 ms. That is 1,200 ms (1.20 s) per loop, looping forever. Leave the settings at their defaults (auto columns, margin 0, spacing 2, padding 0, extrude 1, 100% scale) and here is the whole result, the same numbers the readout above shows before you download:
- Grid: 4 columns × 3 rows. Auto columns is the square root of the frame count, rounded up, and the square root of 12 rounds to 4.
- Cell size: 130 × 98 px: the 128 × 96 frame plus its 1 px extrude ring on every side.
- Sheet size: 526 × 298 px. Frame 1 starts at x=1, y=1, frame 12 sits at x=397, y=201, and the gap between one frame and the next is 4 px: the 2 px spacing plus 1 px of extrude on both sides.
- Timing: in the JSON files, frame_0003.png sits at x=265, y=1 with
"duration": 50, its real delay. In the Godot file the animation speed is 10 and the twelve durations are 1.0, 0.5, 0.5, 1.0, 2.0, 1.0, 0.5, 0.5, 1.0, 1.0, 2.0, 1.0. - Files out: motiongif-sample-sheet.png on its own, or the ZIP (motiongif-sample-spritesheet.zip) with that PNG plus motiongif-sample-sheet.json, motiongif-sample-sheet-array.json, motiongif-sample-sheet.tres, motiongif-sample-sheet.css and a README with the load code for your engine.
These are not round numbers chosen to make the page look good. They are what the tool's layout code produces from the sample's real frame count, size and delays, and you can check every one of them in the readout before downloading anything. Set spacing to 0 and the same arithmetic gives a 520 × 294 px sheet; set columns to 3 instead and it gives 394 × 398 px.
Loading the sheet in your engine
Phaser
For a uniform grid, the spritesheet loader takes the frame size plus the margin and spacing between frame rectangles. For the walk cycle above, margin 1 and spacing 4 (the 2 px spacing plus 1 px of extrude on both sides):
this.load.spritesheet('walk', 'walk-sheet.png', {
frameWidth: 64, frameHeight: 48, margin: 1, spacing: 4
});
Or skip the arithmetic and load the atlas, which works for any layout:
this.load.atlas('walk', 'walk-sheet.png', 'walk-sheet.json');
PixiJS
PixiJS loads the JSON Hash file as a spritesheet; the frames come out named frame_0001.png, frame_0002.png, and so on:
const sheet = await Assets.load('walk-sheet.json');
const frames = Object.keys(sheet.textures).sort()
.map((k) => sheet.textures[k]);
const anim = new AnimatedSprite(frames);
AnimatedSprite plays frames evenly. If the GIF's delays are uneven and that matters, step through the textures yourself using the duration values in the JSON.
Unity
Select the PNG, set Sprite Mode to Multiple, open the Sprite Editor, and choose Slice → Grid By Cell Size. For the walk cycle: Cell Size X 64, Y 48; Offset X 1, Y 1 (the top-left corner of frame 1); Padding X 4, Y 4 (the full gap between one frame and the next). The README in the ZIP prints these numbers for your actual sheet.
Godot 4
The easiest path is the one in the ZIP: keep the .tres file in the same folder as the PNG and assign it to the Sprite Frames property of an AnimatedSprite2D: the frames and their durations are already in it. By hand: add the PNG to a SpriteFrames resource, choose "Add frames from a Sprite Sheet", and set Horizontal and Vertical to the sheet's columns and rows (3 and 3 for the walk cycle).
Frequently asked questions
Why does the ZIP contain JSON files? What are they for?
A PNG is a still picture. It has nowhere to store where each frame sits or how long each frame was shown. The JSON files carry the frame rectangles and each frame's duration, in the TexturePacker format that Phaser's load.atlas and PixiJS read directly. The Godot .tres file carries the same information as a ready-made SpriteFrames resource.
Why does my animation play at the wrong speed in my game engine?
Most likely your GIF's frames have uneven delays, and the engine is playing the sheet at one fixed frame rate, which flattens them. The real per-frame durations are in the JSON files (duration, in milliseconds) and already encoded in the Godot .tres. Engines that slice by grid alone cannot use them; an atlas import can.
How do I stop coloured fringes at the edges of my sprites?
That is texture bleeding: when the GPU scales or filters the sheet, it samples pixels just outside your frame and pulls the neighbour's colours in. Keep about 2 px between a frame's pixels and the next cell. Spacing gives you the gap, and extrude is the stronger fix because it repeats the frame's own edge pixels outward, so the stray sample lands on the right colour.
Do I need a power-of-two sprite sheet?
Only if your target requires one. In WebGL 1, a non-power-of-two texture cannot use mipmaps or repeat wrapping; some older GPUs and compressed texture formats have similar rules. WebGL 2, Canvas, CSS and modern engines accept any size. The power-of-two option pads the canvas with empty space to the next power of two, and your frames do not move.
Why don't the frames in my sheet look like the GIF's raw frames?
Because a GIF rarely stores whole frames. It stores partial patches plus disposal instructions, and players composite them into full pictures as they play. This tool composites first, the same way, so the sheet contains the frames you actually see. A tool that skips this step gives you fragments: pieces of frames with holes where earlier frames should show through.
Related tools
The jobs that usually come before or after a sprite sheet:
GIF Speed Changer
Speed up or slow down an animated GIF by changing its frame timing.
Open the tool →Typing Text GIF Maker
Turn any text into an animated GIF that types itself out, with your choice of font, colors, speed and cursor.
Open the tool →GIF Splitter
Split an animated GIF into separate clips or individual frames.