81 words
1 minute
Set a GIF to loop using ImageMagick
Anubhav Gain
2024-02-28

Set a GIF to loop using ImageMagick#

I managed to accidentally create a GIF that ran once without looping. I think this is because I created it in LICEcap but then deleted some frames and re-saved it using macOS Preview.

I used ImageMagick to get it to loop like this:

convert chrome-samesite-missing.gif -loop 0 chrome-samesite-missing-loop.gif

Note that the output filename comes last, AFTER the -loop 0 option.

I installed ImageMagick on macOS using brew install imagemagick

Here’s the before GIF:

This loops once

And the after GIF:

This loops forever

Set a GIF to loop using ImageMagick
https://mranv.pages.dev/posts/set-a-gif-to-loop-using-imagemagick/
Author
Anubhav Gain
Published at
2024-02-28
License
CC BY-NC-SA 4.0