Gamedev Quick Tools

Atlas packer

Pack sprites of any size into one or more texture atlases, then download the atlas images and a file with every sprite’s position. Values are copied exactly. Your files stay in your browser and are never uploaded.

Images (PNG, JPG, WebP or TGA), up to 256

No images loaded

    Settings

    Preview

    Automatic layout
    100%

    Load images to start.

    Export

    How the atlas packer works

    Sprites are sorted, then placed one by one into the free space of the atlas. Each sprite goes where it leaves the smallest leftover gap on its shorter side, which keeps the free space in large, useful pieces. With rotation allowed, a sprite can also be turned 90° clockwise if that fits better. The packer tries growing atlas sizes and keeps the smallest one that holds every sprite. Sprites that don’t fit in one atlas of the maximum size go on to more pages.

    You can edit the packed layout by hand: drag sprites in the preview, drop one on another to swap them, type exact positions, move a sprite to another page, rotate it or remove it. Moves are only accepted where the sprite stays within the maximum atlas size and keeps the padding to every other sprite, and the page grows when a sprite is moved past its edge. After an edit the layout is manual: positions are kept, and images you add later go into free space without moving anything. Auto-pack discards the manual positions and packs everything again, and so does changing the padding, border padding, extrusion, trim or rotation.

    Trimming removes fully transparent rows and columns around each sprite and records the original size and the offset, so the sprite can be placed back exactly. Textures are read without premultiplying alpha or converting colour profiles, so pixels with an alpha of 0 keep their colour. For a sheet of equal-size frames in a grid, use the flipbook converter instead.

    Metadata

    The metadata file lists every page and every sprite. The files have fixed names: the pages are atlas.png, or atlas_0.png, atlas_1.png and so on when there are several (atlas.tga and so on for TGA), the metadata is atlas.json, atlas.csv or atlas.xml, and the ZIP is atlas.zip. Each sprite has:

    JSON has a pages list (index, file, width, height), a uvOrigin value and a sprites list. CSV has one header row and one row per sprite. XML has an atlas element with page and sprite elements whose attributes use the same names.