When we're making an animation, a game or even an Internet button it is a common need to join a list of images into a single image. The artist creates the images and saves them in a foldes, but when we're going to use them we want them to be a single image in a image strip. Imagemagick solves that well enough with the montage command.

The command bellow, for instance, uses every image file ending with .png in the present folder and joins them into a single, backgroundless image and saves it at the parent folder with the name result.png.


$ montage *.png -tile x1 -background none  -geometry +0+0 ../result.png

The -tile x1 attribute indicates that the resulting image will have a single line of images. If we'd used x2 it would have 2 lines of images and so on.

In order to make a vertical strip simply use y1.

The -background attribute defaults to white. None means transparent.

The geometry attribute sets the size each tile will have. Using +0 we are saying it'll have the same size as the original image, not more, not less.

comments powered by Disqus