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

One thought on “How to tile images using ImageMagick

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s