A sprite sheet packs every frame of a character's animations into one image that a game slices up by grid. Here's how to plan the grid, keep frames aligned so nothing jitters, export it, and import it into Unity, Godot, GameMaker, Phaser or a web page.
The short version. Make every frame the same size, big enough for the largest pose. Put one animation per row. Keep the character anchored to the same point in every cell. Export a transparent PNG at 1×, then slice it in your engine by cell size with nearest-neighbour filtering.
A sprite sheet is a single image that holds many frames — every pose of a walk cycle, or a whole set of items — laid out on a grid. The game loads that one texture and draws a rectangle out of it for each frame. Compared with dozens of separate files, that means fewer loads, fewer texture switches for the GPU (so sprites can be drawn in batches) and animations that stay organised.
There are two kinds:
Every frame in a grid sheet must be the same size. Size the cell for the widest and tallest pose of any animation the sheet will hold — an attack swing or a jump, not the idle pose — and leave a pixel or two of margin so nothing touches the cell edge.
Cells don't have to be square (48×32 is fine for a wide creature), and modern engines no longer require power-of-two textures. If you're on an older or mobile pipeline that does, pad the whole sheet up to the next power of two rather than changing the cell size.
The convention most engines and artists expect is one row per animation, with its frames running left to right. Here's the mascot's eight-frame wave as a one-row sheet:
Keep a short note next to the file — or in its name — with what each row is, how many frames it has and how fast it plays, for example wave: row 0, 8 frames, 7 fps · walk: row 1, 6 frames, 10 fps. Characters that face several directions usually get a row per direction; side-view characters often store only one and flip it in the engine.
Engines place a sprite by its pivot — usually the bottom centre, between the feet. If the character drifts around inside its cell from frame to frame, it will visibly jitter in the game even though every frame looks fine on its own.
The easiest way to get this right is to draw every frame on the same canvas with onion skinning on, so you can see the previous pose underneath. Don't crop frames individually when you export a grid sheet.
When a game draws a sprite at a fractional position or scale, or with smooth texture filtering, the GPU can sample pixels from just outside the frame's rectangle. On a tight grid those pixels belong to the neighbouring frame, and they show up as thin lines along the sprite's edges. You can prevent it in a few ways:
If none of those apply to you, a tight grid with no spacing is the simplest thing to work with.
hero_wave_32x32.png, so whoever imports it knows how to slice it.
Alternatively, use a Sprite2D with Hframes and Vframes set to your grid and animate its Frame property with an AnimationPlayer.
// In the game config: pixelArt: true (nearest-neighbour + whole-pixel rendering)
// preload()
this.load.spritesheet('hero', 'hero_wave_32x32.png', { frameWidth: 32, frameHeight: 32 });
// create()
this.anims.create({
key: 'wave',
frames: this.anims.generateFrameNumbers('hero', { start: 0, end: 7 }),
frameRate: 8,
repeat: -1
});
this.add.sprite(160, 120, 'hero').setScale(4).play('wave');
A one-row sheet animates on a web page with no JavaScript — steps() jumps the background one frame at a time:
.hero {
width: 32px;
height: 32px;
background: url(hero_wave_32x32.png) 0 0;
image-rendering: pixelated;
transform: scale(4);
transform-origin: top left;
animation: wave 1.2s steps(8) infinite;
}
@keyframes wave {
to { background-position: -256px 0; } /* 8 frames × 32px */
}
A single image that holds many animation frames or sprites on a grid. The game loads it once and draws one rectangle from it per frame, which is faster and tidier than loading many separate images.
All frames must be the same size, big enough for the largest pose in any animation plus a pixel or two of margin. 16×16, 32×32 and 64×64 are common, but cells don't have to be square.
Modern engines don't require it. Some older or mobile pipelines still prefer power-of-two textures; in that case pad the whole sheet rather than changing the frame size.
That's texture bleeding: the GPU samples pixels from the neighbouring frame. Use nearest-neighbour filtering, keep sprites at whole-pixel positions, or leave 1–2 pixels of spacing between frames and tell the slicer about it.
In Unity, set the texture to Sprite Mode Multiple and Filter Mode Point, then slice it in the Sprite Editor with Grid By Cell Size. In Godot 4, set the default texture filter to Nearest and use Add frames from sprite sheet in an AnimatedSprite2D's SpriteFrames panel.
Related guides: How to make pixel art · How to animate pixel art and make a GIF · How to make a pixel art tileset · All guides
Try it in the editorFree, in your browser, nothing to install.
Open the editor