On using imagemagick

[back]


Making images smaller

Create a compressed eps from a png:

convert input.png -compress lzw -resize 50% eps2:output.eps

Combining several images

Combine two pictures in one and label them:

montage -label "(a)" -pointsize 60 fig001.png -frame 5 -geometry +100+100 fig001a.png
montage -label "(b)" -pointsize 60 fig002.png -frame 5 -geometry +100+100 fig001b.png
convert fig001a.png fig001b.png -gravity center +append output.png

Combine three pictures in one, two next to each other and the third one below them–and label them:

montage -label "(a)" -pointsize 60 fig001.png -frame 5 -geometry +100+100 fig001a.png
montage -label "(b)" -pointsize 60 fig002.png -frame 5 -geometry +100+100 fig001b.png
montage -label "(c)" -pointsize 60 fig003.png -frame 5 -geometry +100+100 fig001c.png
convert fig001a.png fig001b.png +append fig001c.png -gravity west -append output.png

Combine four pictures in one:

convert \( fig001a.png fig001b.png +append \) \
        \( fig001c.png fig001d.png +append \) -append output.png

Here, the +append option stacks images horizontally, the -append option stacks them vertically.

Stack several image files vertically:

convert -append -density 200 *.eps out.eps

This assumes that we have a folder with image files, named with an increasing index, for example tmp001.eps, tmp002.eps, and so on. if file names jump, for example tmp001.eps, tmp005.eps, and tmp009.eps. in this case, the files must be renamed.

Create an animated gif

Animations from a series of images using imagemagick can be achieved through:

convert -delay 30 -loop 0 *.png animation.gif