Sprite Sheet Slicing: Grid Size, Padding and Pivot Mistakes

· 8 min read · Loopixel team

Grids drawn on a real Loopixel sheet; engine fields from the official docs

A knight sprite sheet sliced with the correct 64 px grid and with a wrong 1 px padding

You import a sprite sheet, press Slice, and the animation plays with a sliver of the next frame, a head cut off or a character that wobbles left and right. Slicing mistakes look like art problems but they are almost always three numbers: the cell size, the padding and offset, and the pivot. This guide shows how to work them out and where each engine asks for them.

On this page · 6

Work out the cell size first

Do the arithmetic before you open any dialog. For a sheet with no spacing, the cell width is the sheet width divided by the number of columns, and the cell height is the sheet height divided by the number of rows. A frequent mistake is typing the sprite’s size from memory instead of reading the image size.

SheetImage sizeColumns × rowsCell size
1 direction, 64 px512 × 648 × 164 × 64
4 directions, 64 px512 × 2568 × 464 × 64
1 direction, 32 px256 × 328 × 132 × 32
4 directions, 128 px1024 × 5128 × 4128 × 128

Loopixel sheets follow this rule exactly: sheet width is 8 × the frame size, a single direction is 1 row and 4 directions are 4 rows. The sizes are 32, 48, 64, 96 and 128 px, with no padding, offset, trimming or rotation. So if your engine’s cell size is not the image width ÷ 8, the number you typed is wrong.

Padding, offset and spacing

These three fields describe space that is not part of any frame. Offset is the margin before the first cell, and padding (or spacing) is the gap between cells. Tools that pack sheets with extra space need them; a sheet with none needs zeros. If you type a padding of 1 on a sheet with no gaps, each cell shifts one pixel further than the last, and by frame 8 you are slicing the wrong pixels.

A knight sprite sheet cut with a correct 64 pixel grid, and the same sheet cut with 1 pixel of padding so each frame drifts further
A real 512 × 64 Loopixel sheet at 2×. Top: cell 64 × 64, offset 0, padding 0. Bottom: the same sheet with padding 1, so each cell lands one pixel further than the last and frame 7 is 7 px off. The grids are drawn over the real sheet.
SymptomLikely mistakeFix
A sliver of the next frame at one edgeCell size too wide, or offset too highRecompute width ÷ columns, set offset to 0
Each frame is further off than the lastPadding or spacing is not 0Set padding and spacing to 0
Last frame is empty or cut offWrong frame count or columnsCheck the count is 8 per row
Frames in the wrong orderReading order or row mix-upRows run top to bottom: front, right, back, left on a 4-direction sheet
Old and new slices both showExisting slices were keptIn Unity use Method: Delete Existing, then Slice

Where each engine asks for the numbers

Unity

  1. Select the PNG, set Texture Type to Sprite (2D and UI) and Sprite Mode to Multiple, then click Apply.
  2. Open the Sprite Editor and use the Slice dropdown in the toolbar.
  3. Choose Grid By Cell Size and set Pixel Size to the cell size (64 × 64). Leave Offset and Padding at 0. Or choose Grid By Cell Count and set the columns and rows (8 and 1, or 8 and 4).
  4. If you sliced before, set Method to Delete Existing, then click Slice.
  5. Check the red preview outlines sit on the frames, then click Apply in the toolbar.

More detail, including animation clips, is in the Unity sprite sheet guide.

Diagram of a 4-direction sprite sheet cut into 32 numbered 64 by 64 slices with offset 0, padding 0 and a bottom pivot
Diagram, not a screenshot of Unity: the settings from the steps above (Grid By Cell Size 64 × 64, Offset 0, Padding 0, Pivot Bottom) drawn on a real 4-direction sheet, with the 32 slices numbered in reading order.

Godot 4

  1. Add an AnimatedSprite2D, create a SpriteFrames and click “Add frames from a Sprite Sheet”.
  2. Pick the PNG and set Horizontal to 8 and Vertical to 1 (or 4 for a 4-direction sheet). Godot divides the image into that grid, so you give counts, not pixel sizes.
  3. Leave any offset or separation fields at 0 if the dialog shows them, select the frames and click “Add N frames”.

There is a full walkthrough, including a free import script, in the Godot sprite sheet guide.

GameMaker

In the sprite’s image editor, GameMaker’s Import Strip Image option (and Convert to Frames for an image already in the sprite) opens a window where you set the number of frames, the frame width and height, and any offsets. For a single-direction Loopixel sheet that is 8 frames at the frame size, with offsets at 0. For a 4-direction sheet, we suggest importing one row at a time, or cutting each row out first, because the documentation describes the window in terms of a strip.

Diagram of a 4-row sprite sheet split into four 8-frame strips with the origin at bottom centre
Diagram, not a GameMaker screenshot: the 4 rows of a real sheet split into four 8-frame strips, each with its origin at the bottom centre.

Aseprite

File > Import Sprite Sheet takes an offset (x, y), the sprite width and height, and padding if there are gaps. Set the width and height to the frame size and everything else to 0. See the Aseprite sprite sheet guide.

Put the pivot at the feet

A pivot (or origin) is the point the engine treats as the sprite’s position. By default it is often the centre of the frame. That causes two problems for characters: a character placed on a ground point sinks half a frame below it, and when you flip or scale it, it moves around the centre instead of staying on its feet.

The same sprite placed on a ground line with its pivot at the feet, and again with its pivot at the centre so it sinks below the line
Same frame, two pivots, drawn on a real sprite. With the pivot at the feet the character stands on the ground point; with a centre pivot it sinks half a cell below it.
  • Unity: in the Sprite Editor Slice overlay, set Pivot to a bottom option, or to Custom and enter a value in Custom Pivot. You can also change the pivot per sprite afterwards.
  • Godot: the AnimatedSprite2D has Centered and Offset. Keep Centered on and set Offset to (0, −half the frame height), or turn Centered off and set Offset to (−half the width, −the full height), so the node’s origin is at the feet.
  • GameMaker: sprites have an origin that you set in the sprite editor; set it to the bottom centre of the frame.
  • All engines: use the same pivot for every animation and every direction so switching animations never moves the character.

The pivot is relative to the frame, so a sheet where the character’s feet are not on the bottom row of the cell needs the pivot at the feet pixel rather than the cell edge. Check one frame at 4× zoom and note the feet row before setting it. This is also why a shared feet line matters across directions, covered in the 4-direction alignment guide.

Sheets that slice with a plain grid

Loopixel sheets are made so the numbers above are easy: cells are fixed squares (32, 48, 64, 96 or 128 px) with no padding, offset, trimming or rotation, 8 per row, so the cell size is always the image width ÷ 8 and every spacing field is 0. A plain grid slice always works. Every ZIP holds all five sizes, plus atlas_{size}.json with frame rectangles, single-frame PNGs in frames_{size}/ and a GIF.

Specs are on the facts page. If you are starting from a character image, image to sprite sheet explains the flow, and pricing lists the credit packs, paid once. The open-source Godot import script does the Godot slicing for you.

Good to know: the pivot is a setting you make in your engine. Sizes are square only, and 4 directions means walk cycles. The animation is AI-generated, so a frame may sit a pixel off the feet line; check and nudge single frames in Aseprite before final export if it matters.

Quick answers

My sheet has extra space between frames. What do I type?

Measure it. The gap goes into padding (or spacing), the margin before the first cell goes into offset, and the cell size is what remains. If you cannot measure it, open the image and zoom to a cell edge.

Should I slice with a grid or use automatic slicing?

Use a grid for fixed cells like these. Automatic slicing cuts around opaque pixels, so frames end up different sizes and the pivot jumps between frames.

Why is every frame offset by the same amount?

That is a pivot or offset issue, not a slicing one. All frames share the same wrong origin. Set the pivot once and apply it to every sprite.

Sources

Engine menu paths and property names above were checked against the official documentation:

Try it with one image

Upload one image and get an 8-frame pixel sprite sheet in about a minute. 1 credit per animation, credit packs from $2.99, paid once.

Create a sprite sheet