Creating an animated GIF from multiple JPEGS (osx)

by Carl Furrow — on  , 


ImageMagick I use homebrew (brew install imagemagick)


brew install gifcicle

Open up a terminal to the folder with the jpgs.

Note, they should be in the frame-order you want them to animate with, so number them ascending. 1.jpg, 2.jpg, 3.jpg, etc.

Put the following script in a file (

This script goes through all the .jpg files in the current directory, and resizes their width down to 500px, and resizes the height based on the current aspect ratio of the image.

for i in *.jpg
  convert -resize 500 $i resized/$i
  echo $i processed

Save the file, then back in the shell make it executable:

$ chmod 700

Make a ‘resized’ folder

$ mkdir resized


$ ./

CD into the ‘resized’ folder that was just created, and run mogrify

$ cd resized
$ mogrify -path . -format gif *.jpg

This will convert all .jpg files to .gif files, which are required for gifcicle to make an animated gif from multiple gif files.

Use gifcicle to create the final gif

$ gifsicle --delay=30 --colors=256 --loop *.gif > animated.gif


Now you’ve got an animated gif file called animated.gif in the ‘resized’ folder. This particular one will loop forever.

 Want to get updates in your inbox? Sign up to receive the newsletter!
Carl Furrow's photo Author

Carl Furrow

Addicted to learning and looking to master the art of solving problems through writing code, while occasionally yelling at computer screens.