Concatenating images in ImageMagick


UPDATE: I’ve since been told an even better way.

I script as much as possible for Rubenerd, including image processing. This is how I’ve been concatenating images side by side for the longest time:

$ montage -border 0             \
	-geometry x$_ORIGINALHEIGHT \
	-tile 2x                    \
	$_IMAGE1 $_IMAGE2           \

But there’s an easier way!

$ montage -mode concatenate $_IMAGE1 $_IMG2 $_OUT

I don’t have an install to try in GraphicsMagick, but my hunch is its ImageMagick-specific.

More code or lines in your scripts are rewarding, but not half as much as being able to take lines out.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.