Using TexturePacker with Spine

Joachim Grill
Last updated:
Using TexturePacker with Spine

What is Spine?

Spine is a 2D skeletal animation tool designed specifically for game development. It enables artists and developers to create smooth, complex animations using bones, meshes, and inverse kinematics. Spine projects are typically exported as data files along with a sprite atlas that contains all the images used in the animations.

Spine's Built-In Packer

Spine includes a built-in texture packer that packs all the images used in animations into a single sprite sheet. This is convenient for quick exports, but it lacks some advanced features needed in production environments.

Why Use TexturePacker?

TexturePacker provides several advantages over Spine's built-in packer:

  • Multi-project packing: Combine sprites from multiple Spine animation projects into a single sprite sheet.
  • Additional assets: Include sprites that are not part of any Spine project.
  • Simplified asset management: Easier to manage sprite atlases across multiple projects.
  • Hardware compression: Supports texture formats like ETC1, PVRTC, and others for mobile optimization.
  • PNG optimization: Reduces file size with lossless or lossy PNG compression.
  • Alpha bleeding: Avoid visual artifacts by adding bleeding pixels around trimmed sprites.

You can download TexturePacker here:

Workflow

Both Spine and TexturePacker use the same set of image assets as input. In Spine, set up your skeletons and animations as usual. When exporting, export only the skeleton data (.json or .skel):

workflow when using Spine with TexturePacker

To create the sprite sheet, drag the images folder from your Spine project onto the left sidebar of TexturePacker. Select the data format Spine. Click Publish to generate both the texture atlas image and the corresponding .atlas metadata file.

setup TexturePacker project for Spine

In Spine, ensure that the option to pack images is disabled when exporting. This prevents Spine from generating its own sprite sheet.

export spine project without packing sprite atlas

Limitations

When using TexturePacker with Spine, be aware of the following limitations:

  • No meshes: If your Spine project does not use mesh attachments, you can safely enable trimming and use all optimization features.
  • Untraced meshes: If your project uses meshes but they are not traced (i.e., use rectangular bounds), trimming must be disabled in TexturePacker to maintain compatibility.
  • Traced meshes: Projects using traced mesh attachments (non-rectangular bounds) are incompatible with TexturePacker. In this case, TexturePacker cannot be used, and you must use Spine's built-in packer instead.

Conclusion

By integrating TexturePacker into your Spine workflow, you can achieve better sprite atlas management and optimization. Just keep in mind the limitations with meshes as described above to ensure compatibility and avoid artifacts displaying parts of neighboring sprites.