StevenTsooo
StevenTsooo

Reputation: 508

Library to merge images into a collage-like output

Looking to automate merging images into a specified grid-like format using code.

Open to different programming languages as I haven't found a great solution yet.

The options I have found so far includes:

  1. https://www.npmjs.com/package/merge-images and writing a node.js script.
  2. Using ImageMagick Montage and writing a bash script.

But I'm looking for something I could use with minimal modifications.

Below is what I'm looking to output as an image.

enter image description here

Upvotes: 2

Views: 694

Answers (1)

fmw42
fmw42

Reputation: 53101

You can do that with ImageMagick 6 if the size are commensurate to your pictures above. Unix syntax

convert image1 \( image2 image3 +append \) -append result


If using ImageMagick 7, replace convert with magick. If using Windows, then remove the \s from before the parentheses.

Note that if your images need resizing so that, say, image1 is 800x400 and image2 and image3 are both 400x400, you can do:

convert image1 -resize 800x400\! \( image2 image3 -resize 400x400\! +append \) -append result

Upvotes: 2

Related Questions