Created
February 3, 2020 23:43
-
-
Save CharStiles/64af0697f77becb769fcdaded4fc0f74 to your computer and use it in GitHub Desktop.
This file contains 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
palindromeGif() { | |
if [[ -n "$1" ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
if [[ $2 != '--big' ]]; then | |
a=$(ls out-static* | wc -l) | |
for p in $(ls -r out-static*); | |
do | |
out=$(printf "out-static-%05d.png" $a) | |
let "a++" | |
cp $p $out | |
done | |
time convert -verbose +dither -layers OptimizePlus -resize 25% \> out-static*.png GIF:- | gifsicle -- colors 256 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
# OptimizePlus | |
else | |
a=$(ls out-static* | wc -l) | |
for p in $(ls -r out-static*); | |
do | |
out=$(printf "out-static-%05d.png" $a) | |
let "a++" | |
cp $p $out | |
done | |
time convert -verbose +dither -layers OptimizePlus -resize 600x600\> out-static*.png GIF:- | gifsicle -- colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
fi | |
rm out-static*.png | |
else | |
echo "proper usage: palindromeGif <input_movie.mov>. You DO need to include extension." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment