Created
October 1, 2015 18:50
-
-
Save nateberkopec/dbc942f18359891fbc0b to your computer and use it in GitHub Desktop.
gifize.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
rm -rf ./.pngs | |
rm -rf ./.gifs | |
mkdir .pngs | |
mkdir .gifs | |
ffmpeg -i $1 -r 10 ./.pngs/out%04d.png | |
sips -s format gif ./.pngs/*.png --out ./.gifs | |
gifsicle ./.gifs/*.gif --optimize=3 --delay=3 --loopcount --resize 720x405 --colors=255 > $1.gif | |
gifsicle --unoptimize $1.gif | gifsicle --dither --colors 48 --resize-fit-width 512 -O2 `seq -f "#%g" 0 2 213` -o $1.optimized.gif | |
rm -rf $1.gif | |
rm -rf ./.pngs | |
rm -rf ./.gifs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment