Export By Group (Recursive) — Aseprite Script
Hi everyone!
I’m Feel, an indie artist and amateur developer.
I’m sharing a script I made (with a lot of help from ChatGPT)
to make my Aseprite workflow smoother — and hopefully yours too!
What this script does
This tool automatically exports visible layers from your Aseprite file into structured folders, based on your group hierarchy. It’s especially handy for projects with many nested groups.
Recursively walks all groups and sub-groups
Supports
@group
→ merges all visible image layers into a single PNG
Automatically trims transparent pixels
Skips groups/layers that contain
#
in their name
Automatically creates export folders based on group names
Writes a full export log to keep track of everything
Define export path inside your Aseprite file (no script editing needed !)
@groups
are now flattened with full opacity & blend mode support !
! New ! Set your export path inside your Aseprite file
Instead of editing the script to set your export folder,
you now simply add a layer named with %
followed by the path.
Example in aseprite, layer name must be :
% E:/MyGame/Exports/
Rules for the export path layer:
- You must have exactly one
%layer
- The name must start with
%
- The path must end with a
/
or\\
- Use double backslashes if you’re using Windows paths (
\\
instead of\
)
Valid:
% E:/MyGame/Exports/
% E:\\MyGame\\Exports\\
Invalid:
% E:\MyGame\Exports
% E:\MyGame\Exports\
Example Aseprite structure
Items
├── @sword_iron → exported as a merged sprite: sword_iron.png
├── @shield_wood → exported as a merged sprite: shield_wood.png
├── #hidden_stuff → ignored automatically
└── coin → exported as individual layer PNGs
Exemple of logs :
[2025-05-22 06:10]
Export from: E:\ -redacted- \exemple project.aseprite
→ Skipped (inherited or contains '#'): #Background
→ Entering group: UI
→ Entering group: Trees
→ Entering group: Items
→ Merging group: @shield_wood
→ Exported: E:/ -redacted- /Items/shield_wood.png (trimmed 157x195)
→ Merging group: @sword_iron
→ Exported: E:/ -redacted- /Items/sword_iron.png (trimmed 84x130)
→ Skipped (inherited or contains '#'): #hidden_stuff
Checking layer: coin
→ Exported: E:/ -redacted- /Items/coin.png (trimmed 68x68)
Total exported : 3 layer(s)
Total skipped : 2 layer(s)
------------
How to install
-
Download the script from GitHub:
GitHub – Export By Group (Recursive)
-
Place the
export-by-group-recursive.lua
file in your Aseprite scripts folder:
C:\Users\YourName\AppData\Roaming\Aseprite\scripts\ -
Run the script in Aseprite via:
File > Scripts > export-by-group-recursive.lua
Let me know what you think! I’d love feedback, ideas, or improvements.
Happy pixel crafting !
It’s my first script and first GitHub project,
so please don’t hesitate to tell me if I forgot something or did anything wrong