3

I am creating a large number of montages using a set of images.

The way I want the montages arranged is with three images across the top and two images across the bottom. The command I have right now is as follows:

montage logo.png 1430410987_ACR02.png 1430410987_ACR01.png \
        1430410987_LHC1.png 1430410987_LHC_dashboard.png   \
       -mode Concatenate -tile 3x3 1_tile.png

This results in a montage of the appropriate arrangement, but features a large empty region to the right, something I don't want. I note that the width of the empty region is the width of the largest of the images used in the montage.

What should I do to ensure that this large empty region is not created?

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
d3pd
  • 7,935
  • 24
  • 76
  • 127

1 Answers1

5

Your right in identifying the empty region having the same width of the largest image. This is caused by -tile 3x3 which assumes 3 images per row. At the bottom of Montage Usage there's a section dedicated to gaps in a montage image, and how it can be controlled with null:. Try the following...

montage logo.png \
        1430410987_ACR02.png \
        1430410987_ACR01.png \
        1430410987_LHC1.png \
        1430410987_LHC_dashboard.png \
        null: \
        -mode Concatenate \
        -tile 3x3 \
        1_tile.png

Another alternative

You can also use convert, sub-process & -append to rebuild the tile image one row at a time.

convert \( logo.png 1430410987_ACR02.png 1430410987_ACR01.png +append \) \
        \( 1430410987_LHC1.png 1430410987_LHC_dashboard.png +append \) \
        -append 1_tile.png
emcconville
  • 23,800
  • 4
  • 50
  • 66
  • Nice work - way to go! No idea why, but I find the second option far more intuitive. Actually, I think I do know why... because the image names are laid out exactly the same way as the images themselves - I must be a visual thinker! Anyway, nice solution :-) – Mark Setchell Apr 30 '15 at 21:47
  • Thanks @MarkSetchell! I agree with you on the second option. Perhaps because it offers more control / flexibility. – emcconville Apr 30 '15 at 22:13
  • Excellent. Thanks for your knowledgeable solution for ```montage``` and your clear solution for ```convert```. Both are great. – d3pd May 01 '15 at 15:28