Skip to content

Instantly share code, notes, and snippets.

@CloverFeywilde
Created August 22, 2018 16:50
Show Gist options
  • Save CloverFeywilde/05a3f8dad5fa6ddbd0c1ac8c5b1ce96c to your computer and use it in GitHub Desktop.
Save CloverFeywilde/05a3f8dad5fa6ddbd0c1ac8c5b1ce96c to your computer and use it in GitHub Desktop.
Remove every other frame & slow down gif animation in Linux
#Get the number of frames from the gif:
identify -format "%n\n" path/to/file.gif | head -1
#Use gifsicle to cut frames. replace 99 with total frames.
gifsicle -U input.gif `seq -f "#%g" 0 2 99` -O2 -o output.gif
#Delay gif via gifsicle by first finding the delay between frames, double it
gifsicle -I input.gif
#Proceed to delay. Replace 50 with the doubled number
gifsicle --delay 50 in.gif > out.gif
#Alt method: Delay with Imagemagick
#First list all frame delays:
identify -verbose your.gif | grep Delay
#double the first number Ex: 5x100 -> 10x100
#slow down the gif:
convert -delay <NewDelay> your.gif your_slow.gif
#For more info:
#https://graphicdesign.stackexchange.com/questions/20908/how-to-remove-every-second-frame-from-an-animated-gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment