Automated Sprite Sheet Cutter

Sprite Sheet Cutter Overview

Why use a sprite sheet cutter?

When you buy sprite sheets from an asset store or game-art provider, they’re often not organized in the way you need them in your game:

  • The sheet contains animations or items you don’t plan to use.
  • There's a lot of empty space around the sprites.
  • You want to merge selected animations or elements with assets from other sources.

To build your own sprite sheets, you have to

  • split the original sheet into sprites
  • repack the sprite sheet for your game

TexturePacker can handle both tasks for you.

Overview

Use TexturePacker's automated sprite sheet cutter to cut your sprite sheets into individual sprites.

The sprite sheet cutter detects the following types of sprite sheets:

  • grid and strip (all sprites have the same size)
  • rectangle (sprites have different sizes, e.g. packed with TexturePacker's MaxRects algorithm)
  • file (by providing a data file such as json, tpsheet, plist, atlas)

It automatically configures the slicing parameters based on gaps between sprites. This makes it a one-click solution for most sprite sheets.

You can save all sprites - or only a selection. Sprites are automatically numbered so that you can extract animations and re-build them later.

The whole process runs comfortably on your computer - no upload of your assets to dubious servers.

Starting the Sprite Sheet Cutter & Adding Sprite Sheets

Starting TexturePacker's Sprite Sheet Cutter
  1. Click the Split Sheet button in TexturePacker's toolbar
  2. Drag and drop a sprite sheet onto the center view
  3. Save the sprites

The splitter now detects the layout of the sprites. This works well if your sprites have some space in between, no matter if the background is transparent or solid. If the detection does not work automatically, or does not slice the sprites as you wanted, use the parameters to adjust the splitter settings.

Cutting Sprite Sheets with Different Layouts

Cutting Grid/Strip-Based Sprite Sheets

Cutting rectangular sprite sheets into sprites

For example, if your sprites are arranged in a clean grid or strip, they should be sliced automatically. Sometimes, if sprites are too close to each other, manual adjustment might be required.

You can use the following settings:

ParameterDescription
Columns & RowsCount the sprites in each column and row and set these parameters. Sprite size is updated automatically according to these settings.
Sprite Width & Sprite HeightIf you know the size of the sprites, use these settings.
Shape PaddingAdjust this to the size of the gap between sprites.
Border PaddingAdjust this to the size of the space from sprite to border.

Cutting Tile Sheets

The tile size might not be detected automatically by the sprite sheet slicing tool. If this is the case, switch to the Grid mode. You can either set the number of columns and rows - or set the tile size using the Sprite Width and Sprite Height settings. Adjust the Shape Padding and Border Padding if your individual tiles are surrounded by transparency or repeating pixels.

Cutting Irregular Sprite Sheets

The sprite sheet splitter automatically switches to rectangular mode if no clear grid layout is detected.

In this mode, it tries to find rectangles that cover a sprite completely. If you know that the sprites were packed with transparency in between, you can increase the Padding value. This allows the cutter to combine, for example, smaller particles into a bigger sprite.

Cutting irregularly packed sprite sheets into sprites

Cutting Sprite Sheets with a solid background color

The sprite cutter automatically works with sprites on a non-transparent solid background color. Sprites are sliced according to the layout of the sheet. However, the transparency is not removed in the sprite itself.

Sprite sheets with a solid background color can only be cut using grid or data file mode.

Splitting with a Data File

TexturePacker creates sprite sheets with optimized layouts. For this, it writes data files for many game engines. The data files contain information about a sprites name, size and position on the sprite sheet. If you have such a file (some asset designers provide them), you can simplify the cutting process dramatically.

If TexturePacker finds a sprite sheet data file with the same name as the texture file (e.g. atlas.png, atlas.plist) for one of the following game engines, it automatically splits the sprite sheets and assigns names to the sprites:

FrameworkFile format (extension)
Cocos2d / Cocos Creatorplist
Godottpsheet
Phaserjson
LibGDXatlas
PixiJSjson
Spineatlas
Unitytpsheet

Naming & exporting Sprites

Set the Output Directory where you want to save your sprites. By default, a folder is created with the same name as the sprite sheet, but without the file extension.

In the center view, select the sprites you want to export:

  • Use CTRL (Windows) or CMD (macOS) with the left mouse button to add or remove sprites from the selection.
  • Press and drag the mouse to use a rubber band selection.

Set the Sprite Name Template for the sprites you want to export. The name can consist of all characters allowed in regular file names, including / to create subfolders. Use the following placeholders to add numbers to your sprite names, which is useful for naming animation phases:

  • {n} to add a number starting with 0.
  • {n1} to add a number starting with 1.

For example, using betty/run-{n1}.png creates a folder named betty inside the output directory. The sprites will be named run-1.png, run-2.png, and so on. Sprite numbers are automatically assigned from the top left to bottom right.

Finally, press Save Selected Sprites (or Save Sprites).

If you have multiple animations or different sprites, repeat the process of selecting, setting the name, and saving.

Repacking & Converting Sprite Sheets

Why Should You Repack a Sprite Sheet?

There are several reasons:

  • You have multiple sprite sheets you want to combine into a single one.
  • Your sprite sheets are inefficiently packed, containing a lot of transparency.
  • You want to create a scaled-down version for different platforms.
  • You want to reduce the file size.
  • You want to port them from one game engine to another.

How to Repack an Existing Sprite Sheet

Use the sprite sheet cutter to extract the sprites from the sheet. Organize them in a folder structure that fits your project's needs. E.g. by grouping animation phases or objects in a subfolder.

Create a new project in TexturePacker and add your top-level sprite folder. Then select your game engine for the export and publish the new sprite sheet.

Extracting Animations from a Sprite Sheet

Animations in a grid / strip layout are easy to handle. They contain transparency for proper alignment. This means they should work out of the box.

It's also no problem if you are using a data file with the sprite sheet. All information is already contained and makes the cutting really easy.

In a rectangle-packed sheet, transparency around the sprites might have been trimmed (removed). Manual work is required here to properly re-align the animation frames.

If the game engine you are creating the new sprite sheet for supports pivot points, it's also really easy to handle animations in TexturePacker. After adding the sprites, switch to the sprite editor panel and use the pivot point tool to align the animations. Use the animation preview window to adjust the alignment in real-time.