Page 1 of 1

Montage, borders and spacing help?

Posted: 2012-05-02T19:17:39-07:00
by tpdi
I'm trying to use the montage command to create a 1x7 array of images, with a background color and vertical spacing between the images.

And I'm hilariously confused, especially by the -border argument.

I'd like to get a my the transparent area of my source images filed with a background color, and then have a full-width by (e.g,) 4 pixel space in another color between each image (and after the last)

image
space
image
space

I'd also like no spacing on the left and right of the images. (I'd call this the "border", but apparently border means something different to montage).

The closest I can get is:
montage -geometry '108x108+0+4' -tile 1x -border 1 -bordercolor '#F9AD88' -background 'red' *.png output.png

but it appears that the border value must be at least 1, and that the border "steals" space from the image.

Short of montaging each image with a spacer, is there a way I can achive this?

Thanks.

I'm runing Version: ImageMagick 6.7.6-6 2012-04-16 Q16 on MS-Windows, using the command line.

Re: Montage, borders and spacing help?

Posted: 2012-05-02T19:43:49-07:00
by fmw42
-border creates a frame around each image.

just create the montage with -geometry to set the spacing and use -background to set the color between image. Then use -trim afterward to get rid of the outside color.

try this as an example:

montage -background red -tile 1x -geometry +0+2 rose: rose: rose: rose: miff:- | convert - -trim rose_montage.png

Note the geometry is +2 in the vertical direction because each image will have border around it of 2. So the total space between successive images will be 4.

Re: Montage, borders and spacing help?

Posted: 2012-05-02T21:20:52-07:00
by anthony
This is also detailed in spliting up arrays of images
See Cutting and Bordering, Separating Spaced-out Tiling Images
http://www.imagemagick.org/Usage/crop/#crop_spaced


There is a plans for various layout operator and methods, including appends with various 'spacing' modes.
However until IMv7 development reaches beta testing, this is not likely to be added.