3

Not sure how to put this question otherwise - but let's assume I have three square images. I'd like to arrange them in a sort of a square 2x2 grid, such that image 2 is bottom left, image 3 is bottom right - and image 1 is top center (so image 1 is not in the cells of the grid on top; neither left cell, nor right cell, but in center of the row delimited by them).

Closest I could get was with this test, done on Ubuntu 14.04, montage --version ImageMagick 6.7.7-10 2017-07-31 Q16:

montage \
  <(convert -size 100x100 xc:green bmp:-) \
  <(montage \
     <(convert -size 100x100 xc:blue bmp:-) \
     <(convert -size 100x100 xc:red  bmp:-) \
     -geometry +5+5 bmp:- \
   ) \
  -geometry +5+5 -tile 1x2 bmp3:- | display

... or as one-liner:

montage <(convert -size 100x100 xc:green bmp:-) <(montage <(convert -size 100x100 xc:blue bmp:-) <(convert -size 100x100 xc:red  bmp:-) -geometry +5+5 bmp:- ) -geometry +5+5 -tile 1x2 bmp3:- | display

The image produced is:

imgck1

What I want instead is something like this (I edited this manually in an image editor):

imgck-edit.png

... that is, somewhat like that old meme Triforce (Wikipedia)

How could I achieve that with ImageMagick's montage?

sdaau
  • 36,975
  • 46
  • 198
  • 278
  • 1
    You could try making a white ( or possibly transparent ) image 50px wide as the first image - so you will have 4 images. Then change the tile to 2x2 – Bonzo Dec 22 '17 at 13:19
  • Thanks @Bonzo - so you're saying I should put in a white image half the width of the others as the first (top left) in 2x2 grid? Makes sense, will give that a try... – sdaau Dec 22 '17 at 13:24

1 Answers1

5

This might be a case where ImageMagick's "convert" command would serve you better than "montage". Here is an example that should get you pretty much the same result...

convert -size 100x100 xc:green xc:blue xc:red -bordercolor white -border 5 \
   \( -clone 1,2 +append \) -delete 1,2 -gravity center -append -border 5 out.bmp

Using "convert" can give you more freedom to arrange the images using "+append" and "-append" to attach them, "-gravity" for alignment, and "-border" for spacing.

GeeMack
  • 4,486
  • 1
  • 7
  • 10