Now available on Microsoft Store — Windows 10 / 11, Chinese and English UI. Get it now →
Home / Blog / Texture atlas

A complete guide to texture atlas packing: padding, trimming, POT and 69 formats

An atlas is more than a big image full of sprites. Padding, extrusion, trimming, rotation and format choice decide runtime sampling quality and memory cost.

Key takeaways

  • Padding and extrusion prevent texture bleeding
  • Trimming saves space but must update descriptors
  • Pick formats based on engine and platform, not habit

Packing a hundred sprites into one image sounds like a packing problem. The issues that show up in production are rarely about fitting them in — they are colored fringes on edges, atlases exceeding a platform limit, or descriptors whose coordinates no longer match.

Padding and extrusion

GPU sampling interpolates neighboring texels. When two sprites touch, the sampler can pull in a neighbor's color, producing a fringe. Padding inserts transparent pixels between sprites; extrusion duplicates the outermost pixel ring outward to reduce bleeding further.

Rules of thumb: 2 to 4 pixels for typical 2D sprites, more when using linear filtering with unpredictable scaling. The atlas also needs a border so the texture edge is not affected by clamped sampling.

Trimming saves space but must update metadata

Many sprites are mostly transparent. Trimming to the alpha bounds and recording the original offset improves atlas utilization significantly — but the descriptor must carry the original size and offset, or runtime placement breaks.

TexForge writes trim information into the engine descriptor; Unity, Godot and Unreal formats all retain the original rectangle and offset. Hand-written export scripts usually miss exactly this step.

Power-of-two and platform limits

Some older devices and compressed formats require power-of-two dimensions. Most modern GPUs accept NPOT, but mobile compressed textures and mip generation are often tied to POT. Check target limits before packing and validate at export time rather than waiting for an engine error.

  • Confirm the maximum dimension: 2048 or 4096 is common on mobile, higher on desktop.
  • Confirm whether POT is mandatory, especially with ETC2 or ASTC compression.
  • Confirm mipmaps: enabling them rounds atlas dimensions up, so padding must be adjusted.

Choosing among 69 formats

Format follows the runtime, not personal preference. Unity uses its own descriptor; Godot differs between 3.x and 4.x; Unreal uses its sprite data; web targets commonly need JSON hash/array, Phaser, PixiJS, CSS or Spine; mini-game platforms have their own conventions.

TexForge exports the atlas image and descriptor together with matching names and folders, ready to drop into a project. For in-house engines, a custom template trims the fields you do not need.

Pre-export checklist

  1. Is the atlas within platform limits, and does it need to be POT?
  2. Is padding sufficient, and is there a border on all sides?
  3. Are trim offsets written into the descriptor?
  4. Do image paths in the descriptor match the actual filenames?
  5. Import it once in the engine to confirm there is no offset or blur.

Takeaway

A good atlas is not the fullest one — it is the one that behaves on the target platform. Padding, trimming, POT and format each map to a real runtime constraint. Encoding those constraints into the packing configuration is far cheaper than debugging sprites later.

Available on Microsoft Store

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

Get it fromMicrosoft Store