montage tile spacing

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jcr

montage tile spacing

Post by jcr »

Hello,

When using montage geometry '+4+4' means that two images will have 8 pixels between and that images will be 4 pixels from the edge of the final image. How can I make the image so that the distance between two images is 4 pixels and not 8 pixels while the distance to the edge remains 4 pixels?

Thank you
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: montage tile spacing

Post by fmw42 »

If you are only using 2 images, you can post process using -slice to remove rows or columns in the middle. See http://www.imagemagick.org/Usage/crop/#chop

However, the better and more general solution is to use -geometry +2+2 and post process with -bordercolor ... -border 2 to add a 2 pixel border all around the outside. See http://www.imagemagick.org/Usage/crop/#border. This will make the space between images 4 and the outside space 4 all around.

montage image1 image2 -geometry +2+2 <otheroptions> miff:- | convert - -bordercolor ... -border 2 resultimage
jcr

Re: montage tile spacing

Post by jcr »

Thank you! Works great!
Post Reply