Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a tool to create a gif animation from a set of png files?

I tried the convert command from the ImageMagick suite, but this doesn't always succeed. Also, I have several issues with this:

  1. I can't tell what the progress is.
  2. No matter what I try, the -delay flag doesn't change the frame rate of the gif animation.
  3. convert determines the frame order based upon the alphabetical order of the files names. This means that name500.png will be placed right after name50.png and not after name450.png I can fix this by adding 0's but this is annoying.
share|improve this question
    
[News] There is a massive overlap between Ubuntu Stackexchange and Unix Stackexchange. I tried to categorize some threads here. –  hhh Dec 30 '12 at 1:07

5 Answers 5

up vote 9 down vote accepted

You may also try to use ffmpeg to create a movie out of a sequence of images and then convert the movie to a GIF animation (again using ffmpeg).

# cf. http://pages.uoregon.edu/noeckel/MakeMovie.html

# first convert an image sequence to a movie
ffmpeg -sameq -i %03d.jpg output.mp4

# ... and then convert the movie to a GIF animation
ffmpeg -i output.mp4 -pix_fmt rgb24 -s qcif -loop_output 0 output.gif
share|improve this answer
2  
This instruction is out of date. –  Andy Jul 16 at 19:03

The convert's --delay option only applies to the next image on the command line. So convert -delay 10 * will only set the delay of the first frame to 0.1 second. The option need to be repeated:

convert $(for a in *; do printf -- "-delay 10 %s " $a; done; ) result.gif

For your sorting need, convert does not sort frames, the shell globing * does. If you know your frames are numbered from 0 to 700, you can just compute the numbers yourself:

convert $(for ((a=0; a<700; a++)); do printf -- "-delay 10 name%s.png " $a; done;) result.gif
share|improve this answer

Update:

Use convert for the png-to-gif, then use gifsicle for the animation. It's not a One App To Do It All solution, but scriptable, for sure.


GIMP can create animated gifs and provides control for timing/delay and repeat, etc

share|improve this answer
1  
I know about the gimp but I don't know how to script it. Besides, the using the gimp to create animation is like killing a fly with a cannon –  Yotam Nov 7 '11 at 7:58

convert is a handy command line tool to do that. cd to the folder containing your png-files and run this command:

convert -delay 10 -loop 0 *.png animation.gif

Source: http://ubuntuforums.org/showthread.php?t=1132058

share|improve this answer
2  
The question mentions convert and some problems using it. Your answer doesn't address any of them. –  Mat Nov 6 '11 at 0:36
    
As of ImageMagick version 6.8.7-4 2013-11-02 Q16 this worked for me. –  Rudy Matela Nov 6 '13 at 17:11

ImageMagick can generate a good quality gif animation. Check this video - http://www.youtube.com/watch?v=OFusYizJ-bA

share|improve this answer
2  
Welcome to Unix & Linux! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. –  slm Apr 18 '13 at 20:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.