How do I make an existing animated GIF loop repeatedly?

I have an animated gif which, as originally created, animates once then stops. I want to modify the image file so it loops forever instead.

What free applications or command-line utilities for Mac OS X can I use to do this? I've found several GIF utilities that can create new animations, but none that let me tweak the properties of existing ones.


Solution 1:

Solution involving the Terminal:

  1. Download the sources of Gifsicle
  2. Unpack the sources and go to the unpacked directory
  3. Do ./configure --disable-gifview --disable-gifdiff
  4. Do make
  5. Do cd src
  6. And finally do ./gifsicle -bl /path/to/image.gif

Solutions using GUI tools (I didn't test any them!):

  1. You can try GifBuilder (requires Rosetta to work with Snow Leopard).
  2. Pixen also seems to be a GIF Editor.

Solution 2:

You can use ImageMagick. You just run:

convert -delay 20 -loop 0 nonloopingImage.gif loopingImage.gif

You may need to install ImageMagick first.

If you use brew you can: brew install imagemagick from the terminal, then you can run the convert command.

Solution 3:

GIMP can edit animated GIFs; open the image in that then save it again. You will be asked a few questions, and one of the available options is to loop forever.

It is apparently possible, or even easy, to install GIMP on OS X, but I can't say I've done it,

Solution 4:

Assuming you already installed Homebrew and run brew install imagemagick.

Just use the command line to do:

convert -delay 15 -loop 0 input.gif output.gif

And this edits your existing image without modifying the existing durations:

mogrify -loop 0 Untitled.gif