Gridwright Start for $1

GIF to Sprite Sheet: Convert Animated GIFs for Your Game

Turn an animated GIF into a sprite sheet your engine can play: whole frames, the GIF's real timing, a clean grid and a Godot 4 SpriteFrames with every delay.

GIF to Sprite Sheet at work
GIF to Sprite Sheet at work: Sprite sheets and frames from animated GIFs.

You have an animation as a GIF. Maybe you drew it in a tool that exports GIFs, maybe it is an old effect from a past project, maybe a teammate sent it over in chat. It plays perfectly in the browser. Then you drop it into your engine and nothing moves. Godot does not import GIF files at all, Unity reads only the first frame, and web frameworks like Phaser want a sprite sheet with a list of frames, not a GIF.

So you look for a way to split the GIF into frames, and the first tool you try gives you twelve PNGs where half the frames are a small square of changed pixels on an empty background, and the timing is gone. This guide explains why that happens, what a GIF really stores, and how to get a sprite sheet that plays in your game exactly like the GIF did. Then it shows the GIF to Sprite Sheet tool doing it in seconds.

Why a GIF is not a list of pictures

A sprite sheet is simple: every frame is a whole picture, all the same size, side by side. A GIF is built differently, and three things in it break a naive split.

Side-View Characters
Side-View Characters: 10 animated 32x32 pixel art heroes and enemies: run, jump, attack, hurt and death, left and right. One of the 150 packs in Gridwright.

Frames can be partial. To keep files small, most GIF exporters store only the rectangle that changed since the last frame. A torch where only the flame moves stores the full torch once, then a few flame pixels per frame. Each frame also says what happens to it before the next one is drawn, its disposal:

  • Keep it and draw the next frame on top. This is the common case, and it is why a stored frame can be a fragment: the rest of the picture is still there from before.
  • Clear its area to transparent before the next frame.
  • Put back what was under it, as if the frame was never drawn.

To get whole frames, you have to replay the GIF the way a browser does: draw each frame on a canvas, apply its disposal, and copy the canvas after every frame. Splitting the file without that gives you the fragments.

Every frame has its own delay. Engines think in frames per second. A GIF stores a delay for every single frame, in hundredths of a second, and they do not have to match. A walk cycle might be 10 hundredths per frame all the way through, while an attack holds its wind-up for 30 and its impact for 20. If you split the GIF and set one fps in your engine, that timing is lost, and the attack loses its weight.

There is one more catch with delays. A GIF saved with a delay of 0 or 1 hundredth does not play at that speed in a browser. Browsers play it as 10 hundredths, a tenth of a second, so the GIF you looked at ran at that speed. The sheet should keep what you saw, not the number in the file.

A GIF says whether it loops. A small block in the file says loop forever, repeat a number of times, or, if the block is missing, play once. An explosion that plays once and a fire that loops forever should become animations that do the same.

Step 1: get whole frames

Replay the GIF, apply each frame's disposal, and keep a full copy of the canvas after every frame. Every frame of your sheet is now the full size of the GIF, with transparency where the GIF had it. GIFs have one transparent colour and no soft edges, which is exactly what pixel art wants: pixels are either there or not.

Pixel VFX
Pixel VFX: 100 animated pixel art effects: explosions, hits, magic, fire, smoke and loot bursts as sprite sheets. One of the 150 packs in Gridwright.

Step 2: lay the frames out

Choose how the sheet is arranged:

  • A strip, one row of frames, is the easiest to read in code and fine for short animations.
  • A grid with a fixed number of columns keeps long animations from becoming a picture thousands of pixels wide.
  • Padding between frames, a pixel or two, stops a neighbour's edge from bleeding in when the engine scales or filters the texture. A margin around the sheet does the same at the border.
  • Trim the empty border that every frame shares. A 64x64 GIF whose character only fills the middle 30x40 makes a sheet with a lot of air; trimming the same amount from every frame keeps them lined up.

For pixel art, scale only by whole numbers (2x, 3x, 4x) and with nearest neighbour, so every pixel becomes a clean block instead of a blur. Many teams keep the sheet at 1x and let the engine scale instead.

Step 3: keep the timing

This is where most converters stop, and where your animation loses its feel. You need each frame's delay next to the frame:

  • In Godot 4, a SpriteFrames animation has a speed in frames per second, and every frame has a duration that multiplies it: a frame plays for its duration divided by the speed, in seconds. So take the delay most frames share as the speed, give those frames a duration of 1, and give the rest their own: a frame held three times as long gets 3. The animation's Loop setting follows the GIF's loop block.
  • In a JSON atlas, write each frame's duration in milliseconds next to its rectangle, and a tag per animation with the frames it covers. That is the layout Aseprite's JSON export uses, so code that already reads Aseprite sheets reads it too.

Step 4: put it in Godot

  1. Put the sheet PNG and the SpriteFrames .tres file in the same folder of your project.
  2. Add an AnimatedSprite2D node and drop the .tres file on its Sprite Frames property.
  3. Pick the animation and press play in the SpriteFrames panel: it should match the GIF frame for frame.
  4. For pixel art, set Project Settings > Rendering > Textures > Default Texture Filter to Nearest, or set the node's Texture Filter to Nearest, so the frames stay sharp.

If you need the animation to face the other way, there is no need for a second sheet: tick Flip H on the node.

The fast way: GIF to Sprite Sheet

GIF to Sprite Sheet does all four steps in your browser:

  • Drop an animated GIF and it replays it the way browsers do, disposal and transparency included, so a GIF that only stores what changed still gives you whole frames.
  • The preview plays at the GIF's real delays, and a strip under it shows every frame with its number and how long it lasts, so you can see the held frames before you export.
  • Lay the frames out as a grid with the columns you choose, or as a strip, with padding, a margin, trimming of the shared empty border, and pixel-perfect scaling up to 8x.
  • Drop several GIFs at once and each one becomes its own animation on the same sheet.
  • One ZIP holds the sheet, every frame as its own PNG, a JSON atlas with each frame's duration, and a Godot 4 SpriteFrames in which every frame lasts as long as it did in the GIF and each animation loops when its GIF does.

Everything runs on your computer. The GIF is never uploaded anywhere.

Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes

Common problems and what causes them

  • Frames flicker or parts vanish in the game: the frames were split without their disposal, so some are fragments. Replay the GIF instead of splitting it.
  • The animation runs too fast: the GIF had delays of 0 or 1 hundredth, which browsers play as 10, and the sheet kept the raw numbers. Use the delay the browser plays.
  • An attack feels flat: every frame got the same speed. Keep each frame's own duration.
  • A thin line from the next frame shows at the edge: no padding between frames, and the engine filtered the texture. Add a pixel of padding and use nearest neighbour.
  • An explosion keeps repeating: the GIF played once, but the animation was set to loop. Follow the GIF's loop setting.

One more thing: convert GIFs you made or have the rights to use. A GIF found online is still someone's art.

A short checklist

  • Whole frames, replayed with their disposal.
  • A strip or a grid, with a pixel of padding and the shared border trimmed.
  • Whole-number scaling with nearest neighbour, or none at all.
  • Each frame's own duration, and the loop setting from the GIF.
  • Sheet and .tres in the same folder, filter set to Nearest.

GIF to Sprite Sheet is one of 44 tools in Gridwright, next to 150 asset packs whose characters and effects already come as sprite sheets with their animations, ready to play.

Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes