I've recorded a .gif
of the screen with ffmpeg. I've used gifsicle
and imagemagick
to compress it a bit, but it's still to big. My intent is making it small by removing, say, a frame every 2 frames, so that the total count of frames will be halved.
I couldn't find a way to do it, neither with gifsicle
nor with imagemagick
. man
pages didn't help.
How can I remove a frame from a .gif
animation every n
frames?
Best Answer
There is probably a better way to do it, but here is what I would do
First, split your animation in frames
Then, select one over n frames with a small for-loop in which you loop over all the frames, you check if it is divisible by 2 and if so you copy it in a new temporary file.
If you prefer to keep all the non-divisible numbers (and so if you want to delete rather than to keep every nth frame), replace
-eq
by-ne
.And once you done it, create your new animation from the selected frames
You can make a small script
convert.sh
easily, which would be something like thatAnd then just call, for example