A script for trimming PNG sequences.
If I’m not mistaken, someone here in the chat has already mentioned optimizing PNG sequences. I do it myself too, manually — it involves a lot of extra steps.
You can run a sequence through Photoshop and, with trimming enabled, save it via Photoshop for Spine and then import that JSON with the sequence into your current project.
I don’t know if this script is really necessary, but personally, I’m already using it and it’s just amazing 🙂
I also plan to add frame rotation for each PNG texture in the sequence (to pack textures even more efficiently) and the ability to optimize sequences on an existing JSON with animation and skeleton, save multiple sequences in one skeleton, or integrate a single sequence into existing ones for multiple skeletons (multi-export), merge multiple different sequences into one animation, support for linked meshes, reverse animations, ready-made presets, and much more.
The list of ideas is quite long 😄
Right now, there are 3 levels of sequence optimization available — trimming (removing empty pixels), scaling (reducing texture size and scaling in Spine as needed), and frame skipping. Later, I’ll also add frame rotation. The video shows how much the atlas is reduced even with just trimming.
Additionally, in the interactive window, you can move the animation track along the timeline and enable/disable fade in/out at the ends if needed. You don’t even need to set keys manually in Spine — the script sets the keys automatically.