Page 1 of 1

Merging images, one img over another over a background img

Posted: 2013-12-19T07:20:28-07:00
by silversonicaxel
Hi guys,
I'm kinda new on imagemagick composition, i explain you my problem.
My goal is a postcard, i have some images and i have to put them one over another.
at first I've a background photo large 500x250 pixel with a 5pixel white border, and over the background I should put some rectangles or circles for the other photos, still white bordered.

Code: Select all

convert.exe -size 600x357 -border 7 -bordercolor White smallPhoto.jpg background.jpg -composite -matte  postcard.jpg
I started to use this command, but it's already wrong the dimension of the picture, that is sized as the smallPhoto.jpg is, not as background.jpg is or as i specified -size 500x250 on the command.

what's wrong with it?
thanks in advance

Re: Multilayer image, one img over another over a background

Posted: 2013-12-19T07:34:31-07:00
by snibgo
"-size" is a setting for some operation, but you have none of those operations.

"-border" will create a border on an image, but you have no image yet.

"-bordercolor" is a setting for "-border", so needs to be before it.

"-matte" is a deprecated command. Use "-alpha set" instead. But it has no effect where you have placed it.

Re: Multilayer image, one img over another over a background

Posted: 2013-12-19T07:39:32-07:00
by silversonicaxel
great explanation, but it still does not solve my problem.

Re: Merging images, one img over another over a background i

Posted: 2013-12-19T08:07:34-07:00
by snibgo
You have two input images, both opaque. I assume that smallPhoto.jpg is smaller than background.jpg, and you want it placed centrally.

Code: Select all

convert background.jpg smallPhoto.jpg -gravity center -composite -bordercolor white -border 7 postcard.jpg