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

Advertisements

2 thoughts on “How to tile images using ImageMagick

  1. Thanks for sharing this.
    Another common use case is that you want to repet a small number of images as a pattern of tiles.
    I found for the case of only one input image the -duplicate option has to be used like in

    montage tile.png -duplicate 149 -tile 10×15 output.png

    Its not clear to me though how to put the -duplicate option in order to get an alternating pattern of few input images.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.