How do I make an existing animated GIF loop repeatedly?

47

18

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.

Brant Bobby

Posted 2010-07-01T22:51:11.067

Reputation: 2 186

Bear in mind that it also depends on the application you are using to display the animated GIF. For example, Firefox's display of animated GIFs can be changed through <code>about:config</code>: <code>image.animation_mode = normal | once | none</code> – Mike Fitzpatrick – 2010-07-01T23:56:11.817

Related: Make a GIF 'video'.

– kenorb – 2015-12-25T20:13:49.010

1do you want it to loop permenantly, so that you will change the file? Or do you want to change a setting locally on your computer to make this work? – Daisetsu – 2010-07-01T23:59:26.737

I want to modify the file, not the app displaying it. I'll edit the question to clarify. – Brant Bobby – 2010-07-02T15:15:27.563

Answers

29

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.

Studer

Posted 2010-07-01T22:51:11.067

Reputation: 3 448

2to expand on your answer, here's what worked for me: first install with Homebrew like a boss: brew install gifsicle then make the loop: gifsicle -l non_looping.gif > looping.gif – Michael – 2014-09-12T14:03:27.477

Thanks Michael, your suggestion works great (brew install gifsicle then make the loop: gifsicle -l non_looping.gif > looping.gif) – Erwin Coumans – 2015-08-01T21:06:40.360

With homebrew on Mac you can just do brew install gifsicle – Just Lucky Really – 2016-10-06T17:27:51.057

1

Gifsicle is definitely the tool for the job. I found it so useful I build a install pkg with binaries for easy deployment, no XCode required. http://dept.psych.columbia.edu/~peter/gifsicle/

– notpeter – 2011-12-15T07:18:19.407

@notpeter How do you use this once you've installed it? – Mazatec – 2012-08-17T23:32:31.810

45

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.

aharris88

Posted 2010-07-01T22:51:11.067

Reputation: 551

3Not preinstalled on mine, a 2014 MBP running OS 10.11. Had to brew install imagemagick. – jasonszhao – 2015-10-12T03:39:18.647

imagemagick ftws – Dan Bradbury – 2017-01-30T19:04:35.683

1If you don't want the gif to loop, use -loop 1 – Flimm – 2018-03-30T08:01:21.630

Works like a charm! Worth noting that -delay <number> may slow down the gif by adding a delay between each frame. https://imagemagick.org/script/command-line-options.php#delay

– mLuby – 2018-04-04T16:48:46.223

Is delay required? If so, why? If not, probably remove it – anthonygore – 2018-04-17T06:04:28.250

9

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,

A N Other

Posted 2010-07-01T22:51:11.067

Reputation: 516

7

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

William Entriken

Posted 2010-07-01T22:51:11.067

Reputation: 2 014

Sidenote: use licecap on macOS to take animated screenshots. – William Entriken – 2017-02-11T21:26:09.453

3

See Michael's Animated GIFs guide.

It describes the GIF Construction Set utility that can display the internal structure of the animated GIF (unfortunately not for OS X). Especially of interest is:

The LOOP control specifies how many times the series of images will be presented. While many animated GIFs are on infinite loop, this can be distracting to the user. This 'noframes' GIF cycles 5 times.

image

It's harder to find free OS X utilities for editing GIF files, especially since I'm not a Mac user. One that seems to fit the bill is Gifsicle, which can set the loop through the "loopcount" parameter.

harrymc

Posted 2010-07-01T22:51:11.067

Reputation: 306 093

2

If you came here for making this change on a PC like I did, GIMP is a great option. A N Other's response is a good one-- here are some specifics to add to their answer.

  1. Open your animated gif in GIMP
  2. Click File > Export As... optionally change the name and click "Export"
  3. Select "As Animation", then check the box "Loop Forever". Click "Export" again

The nice thing about GIMP compared to the other options above is you don't have to write any code or commands-- it's all built in and free. Hope this helps!

GoldAnchor

Posted 2010-07-01T22:51:11.067

Reputation: 21