To concatenate 3 borderless images *and* get a border?

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
abaabheejaa

To concatenate 3 borderless images *and* get a border?

Post by abaabheejaa »

Hi

I wanted to contatenate three images using montage, and get a border between the images to show them as separate. Is that possible?

Also, is it possible to perhaps have a gap between adjoining images?

What I am doing now is:

montage +frame +shadow +label -geometry +2+2 -tile 3x1 image1.tif image2.tif image3.tif final.tif

Thank you for the help,

-Ashu
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: To concatenate 3 borderless images *and* get a border?

Post by anthony »

That should generate at least a 2 pixel gap between all the images.

However montage will generate an array of fixed sized cells with a 2 pixel gap between each image. The 'cells' itself will with those setting be just large enough to hold the largest dimensions of all the images.

This means that is one of the images is very small, it will have a LOT of extra space (the cell size) surrounding it! That may not be what you are after.

An alternative is...

Code: Select all

  convert image1.tif image2.tif image3.tif \
         -background white -splice 2x0 +append \
         -gravity east -splice 2x0 \
         final.tif
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
abaabheejaa

Re: To concatenate 3 borderless images *and* get a border?

Post by abaabheejaa »

The -splice option does not seem to get recognized?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: To concatenate 3 borderless images *and* get a border?

Post by snibgo »

"-splice" is fairly new. What version IM are you on? You may need to upgrade.
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: To concatenate 3 borderless images *and* get a border?

Post by snibgo »

Ah, that might explain the difficulty.

I'm not a Unix guru, but I'd say if you've got the IM programs (convert, mogrify, composite etc) on your path, you probably have IM. Otherwise, you probably haven't.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: To concatenate 3 borderless images *and* get a border?

Post by fmw42 »

try

convert -version

which will output
Version: ImageMagick 6.6.2-4 2010-06-09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features:
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: To concatenate 3 borderless images *and* get a border?

Post by anthony »

snibgo wrote:"-splice" is fairly new. What version IM are you on? You may need to upgrade.
Actually splice is fairly OLD, 6 years old! It was one of the first 'new' options for IM v6, created in November 2004.

See IM examples, Splice: Creating a New Image Operator
http://www.imagemagick.org/Usage/misc/#splice
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply