

This has been my bread and butter command for a long time now.īut lately, I’ve been running into problems using ImageMagick to create longer, larger format gifs. Put it all together and you get:Ĭonvert -delay 3.333 -layers Optimize frames/*.png out.png So if you want 30fps, you’d specify 100 / 30 or 3.333… Not exactly intuitive, but you can get used to anything. The unit you use for the delay parameter is hundredths of a second. And here’s where things get really weird. You need to specify a delay between each frame. You don’t enter frame rate directly with convert though.

Next you need to figure out the frame rate. If I ever need to do more than five minutes in a single clip, five digits will give me almost an hour.Ĭonvert uses simple wildcard matching, so my input is simply frames/*.png and the output can be something like out.gif If you go with three digits, you’ll only get 33 seconds worth. At 30 fps, that gives me about 333 seconds worth of video, or about five and a half minutes. I use four digits, which gives me up to 10,000 frames. For generating an animated gif, you’ll be using the convert command.Īs I said, I keep my frames in a folder called frames. Maybe under the hood it’s all one executable, but it presents as different commands you can call. It’s more of a suite of graphics utilities. It confused me at first, but ImageMagick is not a single executable. Nothing beats thoroughly reading the official docs, but if you just want to get something done quickly, these recipes should help you.

I’ll also try to explain what each of these parameters does, which might help you to come up with your own commands. It’s more of a cookbook of commands that handle specific use cases well. And this post is not meant as thorough documentation on these programs. I’m not any kind of an expert on any of these. So I’m sharing.īoth ImageMagick and ffmpeg are extremely complex programs with tons of parameters that allow you to do all kinds of image, video and audio manipulation. Over the last few years I’ve figured out some pretty good recipes for converting these frames into animated gifs and videos. All of these are initially created by rendering a series of png files into a folder called frames. I create a lot of animated gifs and I’m getting into creating videos as well.
