How to tile images from the CLI


by

# Install dependencies
brew install imagemagick

montage \
    -geometry 250x250+0+0 \
    -background "#000" \
    friend1.png friend2.png friend3.png friend4.png \
    friends.png

Shorter version for input in Bash:

montage \
    -geometry 250x250+0+0 \
    -background "#000" \
    friend{1..4}.png \
    friends.png

250x250+0+0 makes each tile 250x250 with 0 spacing, which gives you a 500x500 image.

Tiled resized images

If you only want to resize images larger than 250, add a > and quotes around the -geometry argument like so: -geometry "250x250>+0+0".

montage \
    -geometry "250x250>+0+0" \
    -background "#000" \
    friend{1..4}.png \
    friends.png

Tiled unresized images