formats

Create Animated GIF in Linux from Command Line

Published on July 31, 2011, by + in linux.




Imagemagick can easily make an animated gif from existing images with a simple command. I’ll show you how!



First, install imagemagick:

$ sudo apt-get install imagemagick





Next, gather all of your .jpg images together in a single folder or directory.


If needed, date/name files in a numbered or sequential order. The manor in which they appear listed in your directory is the order they will appear in the animated GIF!

tmp-file-browser_140




Next, resize your .jpg images to a smaller size, such as 640×480 by using the following command:

$ mogrify -resize 640x480 *.jpg





And finally, issue the command below to create an animated gif of your jpg images.

Increase the delay time for a longer transition between images. Tack loop 0 will loop your GIF indefinitely. Tack loop 3 would loop three times, for example.

$ convert -delay 20 -loop 0 *.jpg myimage.gif





Done!





11 Responses

  1. Jordan

    Thanks for the tip! Was looking for an easier way than using layers in the GIMP… this was perfect!

  2. Drubie

    Thanks dude! I always need a quick reminder of the command names and flags. Keep up the good work!

  3. Deuce

    Thanks a lot. Worked great!

  4. Troy

    Thanks for the post. Worked perfectly.

  5. David

    Wow! Why didn’t anyone tell me about this months ago? I had no idea it was so easy!
    Thanks a million!

  6. coldwater

    thank you so much. a lifesaver you are.

  7. Joel

    Thank you very much. This was exactly what I was looking for.

  8. Damitr

    Thanks. Worked like a charm.

    D

  9. plantpark

    convert.im6: memory allocation failed `image.gif’ What’s the problem? Only 20 jpgs, and 320×240.awaiting for your help,thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Home linux Create Animated GIF in Linux from Command Line