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.jpgmontage *.jpg <output> — Combine all JPEGs in the directory.
montage *.jpg contact-sheet.jpgmontage -tile <cols>x<rows> *.jpg <output> — Specify grid layout (columns x rows).
montage -tile 4x3 *.jpg grid.jpgmontage -tile <cols>x *.jpg <output> — Specify columns only (rows auto-calculated).
montage -tile 3x *.jpg grid.jpgmontage -tile 1x *.jpg <output> — Create a single-column vertical strip.
montage -tile 1x *.jpg vertical-strip.jpgmontage -tile x1 *.jpg <output> — Create a single-row horizontal strip.
montage -tile x1 *.jpg horizontal-strip.jpgThumbnail 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.jpgmontage -geometry +0+0 *.jpg <output> — No margins between images (tight grid).
montage -geometry +0+0 *.jpg seamless.jpgmontage -geometry <width>x<height>+<margin>+<margin>\> *.jpg <output> — Shrink only (don't enlarge smaller images).
montage -geometry 200x200+5+5\> *.jpg thumbnails.jpgmontage -resize <width>x<height> -geometry +5+5 *.jpg <output> — Resize images before creating the montage.
montage -resize 300x300 -geometry +5+5 *.jpg montage.jpgLabels & Titles
montage -label "%f" *.jpg <output> — Label each image with its filename.
montage -label "%f" *.jpg labeled.jpgmontage -label "%f\n%wx%h" *.jpg <output> — Label with filename and dimensions.
montage -label "%f\n%wx%h" *.jpg catalog.jpgmontage -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.jpgmontage -title "My Gallery" *.jpg <output> — Add a title to the entire montage.
montage -title "Photo Collection 2026" -geometry 200x200+5+5 *.jpg gallery.jpgmontage -font <font> -pointsize <n> -label "%f" *.jpg <output> — Set label font and size.
montage -font Helvetica -pointsize 14 -label "%f" *.jpg labeled.jpgBorders & Background
montage -border <n> *.jpg <output> — Add a border around each thumbnail.
montage -border 2 -geometry 200x200+5+5 *.jpg bordered.jpgmontage -bordercolor <color> -border <n> *.jpg <output> — Set border color.
montage -bordercolor white -border 3 *.jpg framed.jpgmontage -background <color> *.jpg <output> — Set the background color of the montage.
montage -background black -geometry 200x200+10+10 *.jpg dark-gallery.jpgmontage -background none *.png <output> — Transparent background (PNG output only).
montage -background none -geometry 100x100+5+5 icons/*.png sprite.pngmontage -shadow *.jpg <output> — Add drop shadows to each thumbnail.
montage -shadow -geometry 200x200+10+10 -background grey95 *.jpg gallery.jpgmontage -frame <width> *.jpg <output> — Add a decorative frame around each image.
montage -frame 5 -geometry 200x200+5+5 *.jpg framed.jpgContact 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.jpgmontage -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.jpgmontage -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.jpgCommon 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.jpgmontage -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.jpgmontage -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.jpgfind . -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
- ImageMagick: montage – official reference for every montage option
- ImageMagick Usage: Montage – in-depth, illustrated collection of examples
- Wikipedia: ImageMagick – background on the image-manipulation suite