Skip to content

Instantly share code, notes, and snippets.

@mrprofessor
Last active October 6, 2025 18:49
Show Gist options
  • Select an option

  • Save mrprofessor/7e211409c2bea046e13f348a6ae471d9 to your computer and use it in GitHub Desktop.

Select an option

Save mrprofessor/7e211409c2bea046e13f348a6ae471d9 to your computer and use it in GitHub Desktop.
Delete frames using gifsicle
#gifsicle -O3 -k 8 --lossy=80 -o tty-small.gif js_demo.gif
#gifsicle --lossy=80 -o tty-small.gif js_demo.gif
#gifsicle --delete "#0-12" -o tty-small1.gif tty-small.gif
#gifsicle tty-small.gif --delete "#0-12" -o tty-small.gif
# Make a copy of the file
cp $1 $2
gifsicle "$1" --delete "#1-10" -o "$2"
gifsicle "$2" --delete "#100-105" -o "$2"
echo "script completed"
@mrprofessor
Copy link
Author

gifsicle input.gif output.gif

@pestophagous
Copy link

At least for my version** of gifscicle, change:

--delete "#1-10"  # this will keep frame 0, which is probably unexpected

to:

--delete "#0-10" 

Note: use 0 instead of 1, because initial frame is numbered 0.

(** version LCDF Gifsicle 1.93)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment