Created
July 8, 2015 16:42
-
-
Save quantombone/472ee783dfbb39320f2e to your computer and use it in GitHub Desktop.
Create animated gif from directory of jpeg images
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
#!/bin/sh | |
# Takes a directory of jpg images and produces an animate.gif | |
# Requires imagemagick's convert tool (Try apt-get install imagemagick) | |
# | |
# Tomasz Malisiewicz ([email protected]) | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 DIRECTORY" >&2 | |
echo "This will produce animate.gif in the current directory" | |
exit 1 | |
fi | |
#Create a temporary directory for the gifs | |
GIFDIR=`mktemp -d` | |
echo "Producing gifs inside" ${GIFDIR} | |
for f in `find $1 -maxdepth 1 -name "*jpg"`; do | |
echo "Image $f" | |
convert $f ${GIFDIR}/`basename $f .jpg`.gif | |
done | |
echo "Making animate.gif" | |
convert -delay 20 -loop 0 ${GIFDIR}/*.gif animate.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment