Export each layer of a file in a different sprite sheet

#1

Using a Bash-like script, we can export each layer as a different sprite sheet doing something like this:

# Separate arguments for the for-loop using newlines instead
# of all kind of whitespaces, which is the output of -list-layers
IFS=$'\n'

# Point the $aseprite variable to the location of your aseprite.exe file
aseprite=“C:/Program Files (x86)/Steam/steamapps/common/Aseprite/aseprite.exe”

for layer in $($aseprite -b -list-layers sprite.aseprite) ; do
  $aseprite -b -layer "$layer" sprite.aseprite -sheet "output-$layer.png" -data "output-$layer.json"
done
2 Likes