Sprite Sheet Tool
  • Sprite Sheet Maker
  • GIF to Sprite Sheet
  • Splitter
  • Texture Atlas
2026/09/11

Sprite Sheet Padding and Spacing: A Texture Bleeding Guide

Sprite sheet padding and spacing: a texture bleeding guide

A thin line from the next sprite appears at the edge of the current frame. A character develops a dark halo when scaled. A tile looks correct in the source PNG but flickers in motion. These symptoms are often grouped under “texture bleeding,” yet adding a random gap is not always the right fix.

The first step is to separate three terms that are easy to mix up:

  • Outer padding is empty space around the outside of the whole sheet.
  • Spacing is the gap between neighboring frame cells.
  • Edge extrusion copies a sprite's border pixels outward into a surrounding gutter.

Sprite Sheet Tool supports outer padding and inter-frame spacing. It does not generate edge extrusion. That limitation matters because transparent space and copied edge pixels behave differently when a renderer samples near a sprite boundary.

Why neighboring pixels can appear

A texture sampler does not always read one exact source pixel. Filtering can combine nearby samples to create a color between texels. Scaling, subpixel camera movement, texture coordinates near a rectangle edge, and mipmaps can all change which neighbors contribute.

On an edge-to-edge sheet, a neighboring sample may belong to the next frame. With a transparent gap, the neighbor may instead be transparent black or another background value, which can create a faint fringe. With edge extrusion, nearby samples repeat the current sprite's border color.

That is why “use two pixels of padding” is incomplete advice. You need to know the sampler, mipmap behavior, camera scale, and importer coordinates. The same sheet can look clean in one setup and bleed in another.

First rule out a slicing error

Bleeding and incorrect rectangles can look similar. Before changing the artwork, check:

  1. The frame width and height match the exported cell size.
  2. The importer uses the same outer offset and inter-cell spacing as the sheet.
  3. The sheet was not resized after it was packed.
  4. The final row does not include a partial or unintended blank cell.
  5. Every frame rectangle stops at the intended cell boundary.

If the importer assumes a gapless grid but your sheet contains spacing, every origin after the first column or row will drift. Adding more space makes that problem worse. Start from exact layout math, not visual guesswork.

When zero spacing is the best setting

For a regular grid sliced by cell size or by row and column count, zero spacing and zero outer padding are the simplest contract. The sheet width is exactly cell width × columns, and each origin is a multiple of the cell dimensions.

This is the default approach on the Unity sprite sheet preparation page and Godot sprite sheet preparation page. It is especially reasonable when pixel art uses nearest-neighbor-style filtering, mipmaps are not part of the chosen 2D pipeline, and the camera keeps sprites on a stable pixel grid.

Zero spacing is not a universal quality setting. It is a layout choice that minimizes slicing variables. If the target renderer still samples across rectangles, fix the relevant import or rendering configuration, or use an asset pipeline that provides an appropriate gutter.

When spacing or extrusion helps

Spacing can physically separate adjacent cells and may prevent one frame from sitting immediately beside another. It is useful only when the importer can account for the same gap. Outer padding protects the first and last cells from the sheet boundary, but it does not separate internal neighbors.

For filtered or mipmapped atlases, edge extrusion is often more robust than empty transparent space because it gives the sampler a matching edge color. The required gutter depends on the renderer and how far down the mip chain the texture will be sampled. Sprite Sheet Tool does not calculate that requirement or extrude edges, so use an engine-aware atlas packer when extrusion is part of your production contract.

Do not simulate extrusion by putting a solid rectangle behind the entire sheet if the sprites require transparency. That changes the asset, not just the gutter.

Keep spacing in the coordinate contract

With cell width W, outer padding P, spacing S, and zero-based column C, a cell begins at:

x = P + C × (W + S)

Rows use the same relationship with cell height. The full width is:

sheet width = (2 × P) + (W × columns) + (S × (columns - 1))

If you change spacing after generating atlas JSON, regenerate the metadata. Coordinates from an older layout no longer describe the PNG.

The free sprite sheet editor calculates its PNG and optional generic or Phaser JSON from the same current layout. Export them together if your runtime reads rectangle metadata. If your engine slices a fixed grid without JSON, record the cell, spacing, and padding values alongside the asset.

A practical troubleshooting sequence

Use the smallest change that identifies the cause:

  1. Confirm rectangles, offsets, and scale against the original PNG.
  2. View the sprite at an integer position and expected camera scale.
  3. For deliberate pixel art, test the engine's nearest-neighbor-style filtering and chosen mipmap policy.
  4. If smooth filtering is required, test an extruded atlas produced by a pipeline that supports it.
  5. Recheck the smallest on-screen scale and motion, not only a magnified still image.
  6. Keep a copy of the gapless source so you can compare one variable at a time.

Avoid “fixing” a halo by painting over transparent edges until you know whether the halo comes from the source alpha, filtering, compression, or the neighboring cell. Those causes need different remedies.

When this guidance is not applicable

Padding is not the answer when the visible line is already painted into the source frame, the sheet was compressed with a lossy format, or the importer is using the wrong rectangle. It also may be unnecessary for UI sprites shown one-to-one without filtering or mipmaps.

A regular grid is not always appropriate for a production atlas. If your runtime supports trimmed rectangles, rotation, per-sprite pivots, and extruded gutters, a dedicated atlas packer can save texture area and encode those details. Sprite Sheet Tool exports unrotated, untrimmed rectangles and does not replace that engine-specific pipeline.

Treat padding as one part of a rendering contract. A clean result comes from agreement among the PNG layout, metadata, texture importer, sampler, mipmap policy, and camera—not from a magic number copied from another project.

All Posts

Table of Contents

  • Why neighboring pixels can appear
  • First rule out a slicing error
  • When zero spacing is the best setting
  • When spacing or extrusion helps
  • Keep spacing in the coordinate contract
  • A practical troubleshooting sequence
  • When this guidance is not applicable

Author

S
Sprite Sheet Tool TeamThe product team that builds and documents Sprite Sheet Tool.

Categories

Sprite Sheet Fundamentals

Tags

Game AssetsPaddingTexture Bleeding

More Posts

Sprite Frame Size: How to Choose a Consistent Cell
Sprite Sheet Fundamentals

Sprite Frame Size: How to Choose a Consistent Cell

Learn how canvas size, visible artwork, pivots, and grid math affect sprite frame dimensions before you pack an animation sheet.

Sprite Sheet Tool Team
2026/09/11
Sprite Animation Timing: Choose FPS Without Losing Holds
Sprite Sheet Fundamentals

Sprite Animation Timing: Choose FPS Without Losing Holds

Plan sprite animation FPS, loop duration, and per-frame holds with simple timing math, then carry those choices into your game engine.

Sprite Sheet Tool Team
2026/09/11
Sprite Sheet Tool

Free browser-based sprite sheet workspace for 2D game developers.

Email

© 2026 Sprite Sheet Tool All Rights Reserved.

Links
  • Sprite Sheet Maker
  • Sprite Sheet Splitter
  • Texture Atlas Generator
  • GIF to Sprite Sheet
  • Unity Sprite Sheet Maker
  • Godot Sprite Sheet Maker
  • Contact
Legal
  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Cookie Policy
Resources
  • Blog