How to join images using ImageMagick

If you want to tile images on a 2D grid, then check out how to use the tile command.

If you just want to join images side-by-side or one below another into a single row or column, then there is an easier command called append.

To join images horizontally side-by-side into a row:

$ convert *.png +append out.png

To join images vertically one below another into a column:

$ convert *.png -append out.png

Tried with: ImageMagick 6.7.7.10 and Ubuntu 14.04

How to tile images using ImageMagick

Tiling images into a 2D grid of one or more rows and columns is an important use of ImageMagick. This operation can be performed using its montage tool.

To tile a set of images, allowing ImageMagick to pick the layout for you:

$ montage *.jpg out.jpg

To tile a set of 7 images, arranged in a single row:

$ montage *.jpg -tile 7x1 out.jpg

To tile a set of 5 images, arranged in a single column:

$ montage *.jpg -tile 1x5 out.jpg

To tile a set of 10 images, arranged in two rows:

$ montage *.jpg -tile 5x2 out.jpg

To specify that only a spacing of 2 pixels be used between images in the above setting:

$ montage *.jpg -tile 5x2 -geometry +2+2 out.jpg

You will notice that montage downsizes images. If you want the resulting image to have the width or height of the original images or a specific width or height, specify it:

$ montage *.jpg -geometry 320x out.jpg

Tried with: ImageMagick 6.8.9.9 and Ubuntu 14.04