Page 1 of 1

border around entire montage?

Posted: 2016-02-08T14:34:02-07:00
by dcohen613
I have a montage that I want to put a border around. I don't want each image in the montage bordered, rather the entire finished product. I can do it in two commands, but ideally want it done in one.

Code: Select all

montage ( ( ( 1.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 2.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 3.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 1.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 2.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 3.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 1.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ( ( 2.jpg -auto-orient -geometry 408x264! ) ( border.png -auto-orient -geometry 408x264! ) -composite -quality 100 ) ) -tile 2x4 -geometry +0+0 -mode Concatenate output_montage.jpg
then

Code: Select all

convert output_montage.jpg -bordercolor white -border 10 finaloutput.jpg
How can I do this in one step?

Re: border around entire montage?

Posted: 2016-02-08T14:41:13-07:00
by snibgo
I don't know montage, but the usual border commands seem to work, eg:

Code: Select all

montage rose: rose: -mode concatenate -gravity center -bordercolor Blue -border 20 x.png
EDIT: Oops, correction. The usual border commands give a border around each image, which isn't what you want.

Incidentally, "-quality" is needed only once, before you write the JPEG file.

Re: border around entire montage?

Posted: 2016-02-08T15:05:16-07:00
by dcohen613
Thanks for the reply. I don't understand the "rose: rose:" portion of it.

I know I overuse -quality and possibly other commands. Can you help show me using my current commands what I need to do?

Thank you so much

Re: border around entire montage?

Posted: 2016-02-08T15:21:12-07:00
by fmw42
You could pipe the output of montage to convert to add the border. Use miff: for the output of montage and - for standard input to convert. That is the only way I know to do that.

Code: Select all

montage .... miff:- | convert - -bordercolor xxx -border y result.jpg
rose: (with the colon) is an internally stored IM image. See http://www.imagemagick.org/script/forma ... tin-images