m (Created page with "= Animations = == Pre-processing of the frames == === cropping === For autocropping: <pre> for i in `ls *jpg`; do convert -trim $i out_$i; done </pre> But if the size is ...")
 
m (Gif)
Line 23: Line 23:
 
  gifsicle --delay=10 --loop *.gif > anim.gif
 
  gifsicle --delay=10 --loop *.gif > anim.gif
  
Convert from ImageMagick also does the trick.
+
Convert from ImageMagick also does the trick:
 +
 
 +
convert -delay 10 -loop 0 $(ls -1 *.png | sort -V) animated.gif
 +
 
 +
The listing is such that it [[normal-orders]] the files, which is usually what one wants to do.
  
 
== Movies ==
 
== Movies ==

Revision as of 12:08, 5 March 2021

Contents

Animations

Pre-processing of the frames

cropping

For autocropping:

for i in `ls *jpg`; do convert -trim $i out_$i; done

But if the size is not the same for all images, the encoding could fail, in this case, force the cropping:

for i in `ls *jpg`; do convert $i -crop '990x870+5+35' out_$i; mv -f out_$i $i; done

Gif

Gif files can be animated using gifsicle [1]

gifsicle --delay=10 --loop *.gif > anim.gif

Convert from ImageMagick also does the trick:

convert -delay 10 -loop 0 $(ls -1 *.png | sort -V) animated.gif

The listing is such that it normal-orders the files, which is usually what one wants to do.

Movies

mpeg can be generated with a command like:

mencoder "mf://*.jpg" -mf fps=10 -ovc lavc -o ./dest.avi

with 10 frames per second.

avconv is also popular. To do lossless compression, you may try:

avconv -f image2 -r 30 -i %03d.png -vcodec qtrle -pix_fmt rgb24 -t 15 qtrle-30fps-rgb.mov