how to create gif animation from a stack of jpgs

2020-02-19 08:21发布

问题:

I have around 200 jpg images. I need to stack them so that i can convert them into a simple animated gif image. Are there any free tools available to do that job? My os is windows. I'm not so bothered about the quality of the output.

回答1:

Might want to look at GiftedMotion: http://www.onyxbits.de/giftedmotion



回答2:

Try using ImageMagick's convert utility. I have used it to create animated gifs from a set of images (in any format) in the past.

Use the command

convert -delay 20 -loop 0 *.jpg animated.gif


回答3:

If you'd like a flexible on-line solution, I just used GIFmaker.me and it worked great. It lets you change the frame order, change the size, set the speed, and set the repeat cycles. You can view the animated GIF and download it when you're finished.

Edit: I just used another on-line tool that GIFmaker refers to on their site. GIFcreator is even more flexible, letting you duplicate frames, change the delay for each frame, remove frames, and reverse frames. It also has a more flexible resize capability.



回答4:

ImageJ and FIJI provide a powerful GUI for doing this is (FIJI is a package of ImageJ that also includes some widely used plugins). Admittedly these are powerful (but free!) programs that may be overkill, but depending on your needs this may be the way to go.

Also FIJI can open a large array of different image types, can save to GIF or AVI, and it is very easily scriptable (insternally with in Python or Java) for automating custom tasks etc.

Step-by-step instructions (from Here and Here) are as follows:

  1. Put your images in a folder, and name them in sequence (eg. make sure they open alphabetically in the right order, perhaps by adding the desired frame numbers to the start of the filenames)
  2. In FIJI, Select `File > Import > Image Sequence..."
  3. Choose your folder, and then any options (eg. scaling the images)
  4. Preview the video with the Play button in the resulting window's corner.
  5. To change the frame rate, choose Image > Stacks > Animation > Animation Options...
  6. Select File > Save As > Animated GIF... or AVI... and you're done.

    For GIF you can choose the delay between frames (ie. frame rate), and looping option. For AVI you can choose the frame rate.



回答5:

In theory this would work

ffmpeg -f image2 -i image%d.jpg video.avi
ffmpeg -i video.avi -pix_fmt rgb24 -loop_output 0 out.gif