montage — Build Image Montages and Contact Sheets

Practical guide to montage (ImageMagick): create contact sheets, thumbnail galleries and image grids with tile layout, frames, labels and titles.

montage from the ImageMagick suite arranges several individual images into a single composite – from a classic contact sheet to thumbnail galleries and comparison grids. You control the number of columns and rows with -tile, size and spacing with -geometry, and add captions with -label and -title. On ImageMagick 7 you preferably invoke the tool as magick montage; the classic montage command stays compatible. This guide walks you through the options you actually reach for day to day.

Basic Usage

montage <image1> <image2> ... <output> — Combine images into a grid with default settings.

montage photo1.jpg photo2.jpg photo3.jpg photo4.jpg grid.jpg

montage *.jpg <output> — Combine all JPEGs in the directory.

montage *.jpg contact-sheet.jpg

montage -tile <cols>x<rows> *.jpg <output> — Specify grid layout (columns x rows).

montage -tile 4x3 *.jpg grid.jpg

montage -tile <cols>x *.jpg <output> — Specify columns only (rows auto-calculated).

montage -tile 3x *.jpg grid.jpg

montage -tile 1x *.jpg <output> — Create a single-column vertical strip.

montage -tile 1x *.jpg vertical-strip.jpg

montage -tile x1 *.jpg <output> — Create a single-row horizontal strip.

montage -tile x1 *.jpg horizontal-strip.jpg

Thumbnail Size & Geometry

montage -geometry <width>x<height>+<margin>+<margin> *.jpg <output> — Set thumbnail size and margin between images.

montage -geometry 200x200+5+5 *.jpg thumbnails.jpg

montage -geometry +0+0 *.jpg <output> — No margins between images (tight grid).

montage -geometry +0+0 *.jpg seamless.jpg

montage -geometry <width>x<height>+<margin>+<margin>\> *.jpg <output> — Shrink only (don't enlarge smaller images).

montage -geometry 200x200+5+5\> *.jpg thumbnails.jpg

montage -resize <width>x<height> -geometry +5+5 *.jpg <output> — Resize images before creating the montage.

montage -resize 300x300 -geometry +5+5 *.jpg montage.jpg

Labels & Titles

montage -label "%f" *.jpg <output> — Label each image with its filename.

montage -label "%f" *.jpg labeled.jpg

montage -label "%f\n%wx%h" *.jpg <output> — Label with filename and dimensions.

montage -label "%f\n%wx%h" *.jpg catalog.jpg

montage -label "%f\n%b" -pointsize 12 *.jpg <output> — Label with filename and file size, custom font size.

montage -label "%f\n%b" -pointsize 12 *.jpg info-sheet.jpg

montage -title "My Gallery" *.jpg <output> — Add a title to the entire montage.

montage -title "Photo Collection 2026" -geometry 200x200+5+5 *.jpg gallery.jpg

montage -font <font> -pointsize <n> -label "%f" *.jpg <output> — Set label font and size.

montage -font Helvetica -pointsize 14 -label "%f" *.jpg labeled.jpg

Borders & Background

montage -border <n> *.jpg <output> — Add a border around each thumbnail.

montage -border 2 -geometry 200x200+5+5 *.jpg bordered.jpg

montage -bordercolor <color> -border <n> *.jpg <output> — Set border color.

montage -bordercolor white -border 3 *.jpg framed.jpg

montage -background <color> *.jpg <output> — Set the background color of the montage.

montage -background black -geometry 200x200+10+10 *.jpg dark-gallery.jpg

montage -background none *.png <output> — Transparent background (PNG output only).

montage -background none -geometry 100x100+5+5 icons/*.png sprite.png

montage -shadow *.jpg <output> — Add drop shadows to each thumbnail.

montage -shadow -geometry 200x200+10+10 -background grey95 *.jpg gallery.jpg

montage -frame <width> *.jpg <output> — Add a decorative frame around each image.

montage -frame 5 -geometry 200x200+5+5 *.jpg framed.jpg

Contact Sheets

montage -tile 5x -geometry 200x200+5+5 -label "%f" *.jpg contact.jpg — Create a classic contact sheet with filenames.

montage -tile 5x -geometry 200x200+5+5 -label "%f" *.jpg contact.jpg

montage -tile 4x -geometry 250x250+10+10 -background black -fill white -label "%f\n%wx%h" *.jpg sheet.jpg — Dark-themed contact sheet with dimensions.

montage -tile 4x -geometry 250x250+10+10 -background black -fill white -label "%f\n%wx%h" photos/*.jpg sheet.jpg

montage -tile 6x -thumbnail 150x150 -set label "%t" *.jpg thumbs.jpg — Quick thumbnail overview (label without extension).

montage -tile 6x -thumbnail 150x150 -set label "%t" *.jpg thumbs.jpg

Common Patterns

montage -tile 3x2 -geometry 400x300+0+0 slide*.jpg comparison.jpg — Create a before/after comparison grid.

montage -tile 3x2 -geometry 400x300+0+0 slide*.jpg comparison.jpg

montage -mode Concatenate -tile x1 left.jpg right.jpg sidebyside.jpg — Concatenate images side by side (no resizing).

montage -mode Concatenate -tile x1 before.jpg after.jpg comparison.jpg

montage -mode Concatenate -tile 1x top.jpg bottom.jpg stacked.jpg — Stack images vertically (no resizing).

montage -mode Concatenate -tile 1x header.jpg body.jpg footer.jpg page.jpg

find . -name '*.jpg' -print0 | xargs -0 sh -c 'montage "$@" -tile 5x -geometry 150x150+3+3 gallery.jpg' sh — Create a gallery from images in subdirectories.

find photos/ -name '*.jpg' -print0 | xargs -0 sh -c 'montage "$@" -tile 5x -geometry 150x150+3+3 gallery.jpg' sh

Conclusion

montage does in a single command what would otherwise mean opening an image editor: tiling, labelling, framing and assembling images into one composite. Keep in mind that montage writes an output file and overwrites an existing target without asking – so choose the output path deliberately. -geometry sets thumbnail size and spacing, -tile sets the grid; together they determine the entire look. On ImageMagick 7, magick montage is the recommended way to invoke it.

Further Reading

  • convert – the all-purpose ImageMagick tool for converting and editing images
  • composite – overlay and combine two images into one
  • display – show and interactively edit images straight from the shell