[Script] Export sprite sheets separately

Export Slices

Export a sprite sheet into individual files, each one named and grouped
accordingly. Commissioned by Imvested for his Minecraft resource pack.

Introduction and description

Hi again!
After my first and very well received here post about a script to export a sprite’s layers as individual images I was contacted by a user called Imvested for a commission. He wanted to export slices in specific folders and with specific names. He’s working on about 1000 textures for a Minecraft server and needs to export them into specific folders, so this saves him a lot of time.

Usage

You have to set up your slices in your sprite first. Use the slice tool (alt. to
the move tool) to create slices. Double-click a slice to edit its Name and User
Data values. These values are used for the exported filename. You can use /
(Linux/macOS) or \ (Windows) to nest folders.

Options

  • Output directory: The folder where to export. Note that you will specify a
    file, not a folder. This is because Aseprite’s API doesn’t support folder
    selection.
  • File name: The name of every exported file. The possible formatters are:
    {spritename}: The name of the sprite to export.
    {slicedata}: The user data of the slice.
    {slicename}: The name of the slice.
  • Export format: File format of exported files.
  • Export scale: The scale at which to export. The resolution of the file will
    be multiplied by this number. Useful for media sharing.
  • Save sprite: If checked, the full sprite will be saved in the output
    directory.

Examples

  • A slice with name slice1 will be exported as slice1.png.
  • A slice with name slice2 and User Data group1 will be exported as
    group1/slice2.png.
  • A slice with name slice3 and User Data group1/subgroup1 will be exported
    as group1/subgroup1/slice3.png.

Note.- Examples made for Linux/macOS systems. Replace / with \ for
Windows.

Download

You can download my scripts from here: GitHub - PKGaspi/AsepriteScripts: My collection of Aseprite Scripts.

Installation

  1. Download or clone this repository.
  2. In Aseprite, go to File → Scripts → Open Scripts Folder.
  3. Copy the content of this repository’s script folder into the opened script
    folder.
  4. In Aseprite, go to File → Scripts → Re-scan Scripts Folder.

Changelog

  • v2.0 - Added name formatting, different file formats and a scale export factor.
  • v1.0 - Initial release.

I hope you find this script useful and thank you very much for using it!
Any comment, feedback or suggestion is appreciated!
And again, thanks to Imvested for the commission!

4 Likes