[Script] Reduce Frames

Hi all,

I’ve always enjoyed rotoscoping in Aseprite, and sometimes there are too many frames to deal with so I made a simple script to systematically trim down the frame count.

Made this a while ago but I hope some of y’all find this useful!

5 Likes

Practical and intuitive.

Dude, I would like to request a reverse feature, extended frame: For example, the 100ms image of “1234” is expanded to the 50ms image of “11223344”.

if you could reverse this script ot add more hold frames between that be cool as hell. like go from animating in ones to animating in twos you know.

There is a dialog in AsepriteAddons under dialogs/anim/expandFrames.lua that might be suitable.

There’s an option to sustain frames

sodomIntroSustain

and to cross-fade them

sodomIntroCrossfade

Test image: https://streetfighter.fandom.com/wiki/Sodom/Sprites?file=Sodom-Intro.gif

Expanding frames is trickier than reducing them because you have to deal with the layer hierarchy, including reference layers, tile map layers, etc. You also have to decide how to handle properties other than the image pixels. For example, if frame 1 has 20 millis duration and frame 2 has 40, then the script will interpolate the between frame’s duration as 30. Same goes for cel z-index.

There’s also a matter of animations intended to be a loop:

sodomIdleLoop

Test Image: https://streetfighter.fandom.com/wiki/Sodom/Sprites?file=Sf-sodom.gif

Tags would be the biggest complication, as people use them to signal whether an animation should ping-pong, or repeat for a fixed number of times. Given that they can partially or wholly overlap, I find tags too much of a hassle to consider in a script.

oh i just mean the ability to hold a frame for longer, if you wanna animate on twos, you do one key frame, one hold frame, but if i want to do that on a naimation of 1 i have to go throught and extend all keyframes, and thats only on twos, its even more annoying if i want to do it on threes or fours, its just a lot of work.

1 Like

My solution is to use GIF Movie Gear.
For example, A.gif is a 4-frame animation with 100 milliseconds per frame, and the content is 1234. In order to align it with another animation that B.gif is 50 milliseconds per frame, I need to expand A to the same speed, becoming 11223344.
Open A.gif with the software, adjust it to a blank screen, 8 frames, 50 milliseconds per frame, and save it as A+.gif.
Then, open A+.gif with GIF Movie Gear, click on the top left [file][blend animation with…], insert A.gif, do not change the offset (since the image size and position are the same), select “synchronize time,” and [confirm]. After this, save the modified A+.gif.
Now I have a new A+.gif with content 11223344 and 50 milliseconds per frame.

I updated the script I linked above based on what you and Ethan have described. A video might get the point across better than a description:

1 Like

NICE! im taking this immediatly