Wednesday, November 23, 2011

Resizing images and generating animated gifs

After writing my last posts (Plotting memory usage on console and More trickery with gnuplot dumb terminal), I had to put here some lines used to make the screenshot I'd put there.
To resize all screen shot frames:

ls -1 *.png | cut -d . -f 1 | while read line ; do convert $line.png -resize 60% $line.mini.png; done


In stead of resizing the image, they can be cropped:
ls -1 *.png | cut -d . -f 1 | while read line ; do convert $line.png -crop 400x270+92+37 $line.mini.png; done

To make the animated gif
convert -delay 100 -loop 0 screenshot0*mini.png screenshot.gif

1 comment: