
If you want to transform a sequence of still photos into an animated GIF — much like a photo-booth style flip-book effect — then the command-line tool ImageMagick makes it surprisingly easy. Below you’ll find how to set it up, how to use it, plus extra tips to make your GIFs look great.
✅ Setup
- Install Homebrew (on macOS) if you haven’t already: – https://brew.sh/. After installation, you may need to add Homebrew’s bin and man paths to your shell profile (for example ~/.zprofile or ~/.bash_profile).
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Once installation completes, read the closing notes. It might ask you run few commands like this.
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/pkasi/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/pkasi/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- Use Homebrew to install ImageMagick (and its dependencies): https://imagemagick.org/script/download.php
brew install ImageMagick
# ImageMagick depends on Ghostscript fonts, so we need to install this as well
brew install ghostscript
🛠Create the GIF
- Once you have a folder of images (for example .png or .jpg) ready: Run the tool to create gifs from photos
Note: Newer versions of ImageMagick prefer magick as the command; convert is still supported for backward compatibility.
# Switch to the directory that has multiple jpg or png
convert *.png selfie-nov-2022.gif
(OR)
magick *.png selfie-nov-2022.gif
You can control the speed of the frame(how fast the images flip) using the -delay and -quiet to suppress all warning that gets logged in the terminal. Read more about different options here
Here, -delay 50 means each image is shown for 50/100 seconds (i.e., 0.5 s), and -delay 100 for 1 s.
magick -delay 50 *.png selfie-nov-2022.gif
magick -quiet -delay 100 selfie-dec-2022.gif

convert -delay 150 *.jpg imagemagick-nov-2022.gif
🎨 Extra Tips to Improve Your GIFs
Consistent image sizes: Before combining images, ensure they all share the same dimensions (width/height) or the animation may exhibit jumps or flickers. You can resize them all with ImageMagick:
magick *.jpg -resize 800x600\! resized-*.jpg
The \! forces exact dimensions, but keep aspect ratio in mind.
Optimize file size: GIFs tend to balloon in size. After creation, you can reduce colors or remove duplicate frames:
magick output-animation.gif -fuzz 10% -layers Optimize optimized.gif
