Skip to content

Instantly share code, notes, and snippets.

@surma
Last active May 12, 2017 21:30
Show Gist options
  • Save surma/d361d177d25bee798ee02cd2f5bef843 to your computer and use it in GitHub Desktop.
Save surma/d361d177d25bee798ee02cd2f5bef843 to your computer and use it in GitHub Desktop.
Convert video to gif
#!/bin/bash
FUZZ="0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0%"
COLORS="128 256"
CONV_OPTS="-resize 450 -layers optimize-plus -layers optimize-transparency"
mkdir output
for f in $FUZZ; do
convert +repage -fuzz $f -delay 4 -loop 0 $@ $CONV_OPTS ./output/im-$f.gif
for c in $COLORS; do
gifsicle -O3 --colors $c ./output/im-$f-0.gif > ./output/gs-$f-$c.gif
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment