
-coalesce apparently “fully define the look of each frame of an GIF animation sequence, to form a ‘film strip’ animation,” according to the documentation. Most videos play back at between 25 and 30 fps, so you may have to drop every other frame or so if you care about accuracy of playback speed. Note that most browsers slow down animations that play faster than 20 frames per second, or 1/50 second per frame. I computed this number by looking at the frame rate of the original video (24) and dividing by the number of frames each drawing plays for (3). -delay 1x8 says that the animation should play a frame every 1/8 of a second. convert PNG sequence to animated GIF convert frames/*.png -delay 1x8 -coalesce -layers OptimizeTransparency animation.gif
frames/frame-%03d.png is a printf format string specifying the output filenames, in this case dir/name-#.png, a series of PNG images called 001.png, 002.png, 003.png, and so on.Ģ. -f image2 the output format, a series of still images. convert video to PNG sequence with FFMPEG ffmpeg -i video.mov -r 10 -s 640x400 -f image2 frames/frame-%03d.png Scale and stack images convert *.png -append -scale 50% stacked.pngĪnimated gif from png files convert -delay 5 -loop 0 *.png. Mosaic with cropped images montage crop*.jpg -geometry 460x460+0+0 mosaic.jpg
Resize to fit with background convert *.png -background black -resize 1024x768 -gravity center -extent 1024x768 fit.png
Resize and crop convert *.jpg -resize "460x460^" -gravity center -crop 460x460+0+0 +repage crop.jpg Resize, change dpi and quality convert *.jpg -resize 1600 -quality 70% -depth 72 -units pixelsperinch resized.jpgĬonvert *.jpg -set filename:original %t -resize 1600 -quality 70% -depth 72 -units pixelsperinch 'resized_%.jpg' convert images and save to another dir convert *.png -set filename:original %t 'export/%.jpg' Remember that the order of parameters/options is very important.