Created
October 2, 2015 12:16
-
-
Save jrialland/e5dddbf99e0ef62d47a7 to your computer and use it in GitHub Desktop.
Converts the successive outputs of a program into a splendid animated gif
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
#!/bin/bash | |
start=$1 | |
end=$2 | |
command=$3 | |
outputfile=$4 | |
delay=10 | |
rm -rf /tmp/outputToGif 2>/dev/null | |
mkdir -p /tmp/outputToGif | |
for i in $(seq $start $end); do | |
echo $i/$end | |
$command $i | convert -background white -fill black -font courier label:@- /tmp/outputToGif/tmp$(printf "%08d\n" $i).gif | |
done | |
convert -layers Optimize -delay $delay -loop 0 /tmp/outputToGif/tmp*.gif $outputfile | |
rm -rf /tmp/outputToGif 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment