$16.99 on Microsoft Store — Windows 10 / 11, one-time purchase, English & Chinese UI. Get it now →
Home / Blog / Unity

Unity sprite atlas workflow: padding, max size and compression that do not backfire

How to pack sprites for Unity: padding and extrusion values that stop edge bleed, how max texture size interacts with device tiers, and which compression format to pick per platform.

Key takeaways

  • Padding fixes edge bleed; extrusion buys tolerance for filtering and rotation
  • Max size is a ceiling set by the weakest device you ship, not a target
  • Decide the compression format before packing, because it changes what the atlas can hold

Unity's built-in Sprite Atlas is convenient, and for a small 2D project it is enough. The problems start when an atlas is shared by UI, characters and effects: a sprite picks up a thin line from its neighbour, or the whole atlas quietly drops to half resolution on a mid-range phone. Both symptoms come from numbers that were typed before packing, and both are cheap to avoid.

Why pack outside Unity at all

Two reasons are practical rather than ideological. First, you often need the same source folder exported for several targets — Unity for the game, a raw PNG sheet for a marketing page, a different descriptor for a prototype in Godot. Second, packing 400 loose PNGs inside the editor means the editor owns the layout; a CLI step keeps the atlas reproducible in CI, where no editor is running.

TexForge does the packing and writes the descriptor; Unity still imports the result as a normal texture with sprite metadata. Nothing about the runtime changes.

The two numbers that cause edge bleed

Bilinear filtering samples a little outside the sprite rectangle. With a padding of 0, that sample lands on the neighbouring sprite, and you see a one-pixel fringe that changes with the sprite's position on screen. The fix is a gutter, and the usual mistake is making it too small for the mip levels you ship.

SettingStarting valueWhat it actually controls
Padding2 px (UI), 4 px (scaled sprites)Empty gutter between sprites; must survive the lowest mip you sample
Extrusion1 pxRepeats the edge pixel outward, so filtered samples stay inside the sprite
TrimOn for characters, off for 9-sliceRemoves transparent borders; changes pivot offsets, so verify in engine
RotationOff until measuredHigher occupancy, but rotated sprites complicate debugging and some shaders

A practical rule: if the atlas will be sampled at half or quarter resolution (mipmaps on, camera zoomed out), double the padding. A 2 px gutter that looks clean at 1:1 can still bleed at mip 2.

Max size is a device decision

Every texture has a hardware ceiling, and the ceiling that matters is the oldest phone you support, not your development machine. 2048×2048 is the safe default for mobile; 4096 is fine on desktop and modern consoles, but a 4096 atlas on a low-tier Android device either fails to load or is downscaled by the driver, which is worse because it happens silently.

If a folder does not fit, do not raise the ceiling. Split by loading context: one atlas for the main menu, one for gameplay UI, one per character. That also reduces the memory spike when a single screen loads.

Compression: pick the format, not the slider

Unity exposes compression as a quality slider for Sprite Atlas, but the underlying format still depends on the platform override. For 2D art the common choices are:

  • ASTC 6×6 on mobile — around 3.56 bits per pixel, a reasonable quality/size balance for UI and characters.
  • BC7 on desktop — 8 bits per pixel with good alpha, the default choice for gradients and soft shadows.
  • BC1 (DXT1) only for opaque art with no smooth alpha; banding on gradients is visible at 4 bits per pixel.
  • Uncompressed for pixel art and anything with hard 1 px lines — block compression turns crisp edges into mush.

Block compression works on 4×4 blocks, so a sprite sheet full of 8 px icons loses more than a sheet of large illustrations. If the art is pixel-perfect, leave it uncompressed and reduce the count of atlases instead.

A repeatable sequence

  1. Scan the source folder and confirm the file list before touching settings — extension, size range and naming filters are cheaper than undoing a bad batch.
  2. Set layout, padding and trim, then preview occupancy. A half-empty atlas is a sign the source should be split by scene, not packed harder.
  3. Validate power-of-two and max size against the weakest target device.
  4. Export the Unity descriptor together with the PNG, into the folder the engine project already watches.
  5. Open the atlas in Unity once and check three things: pivot alignment after trimming, edge quality at 50% zoom, and the format the platform override actually produced.

What this workflow does not do

It does not manage Sprite Atlas V2 variants, addressable groups or runtime atlas swapping — those belong to Unity's own asset pipeline. It also does not fix a source-art problem: if sprites are authored at inconsistent pixel densities, no packing setting will make them match. Use it to make the packing step deterministic and reviewable, and keep engine-side variant logic in the engine.

Checklist before you ship

  • Padding at least 2 px, doubled when mipmaps are enabled.
  • No atlas above the smallest supported device's limit.
  • Compression chosen per art type, not one global setting.
  • Descriptor and image share a name and folder.
  • The packed result was opened in the engine at least once, at 50% and 100% zoom.

Related reading: the general guide to atlas packing, mipmaps and platform limits, and sprite sheets and nine-patch. The feature list lives on the features page; price and Store details are on pricing.

Available on Microsoft Store

Install directly on Windows 10 / 11 (x64). Chinese and English UI included.

Get it fromMicrosoft Store