Page 1 of 1

composite from portion of another image.

Posted: 2010-07-06T18:27:20-07:00
by philh
I've been trying to figure out a way to take a portion of one image and composite it on another with out running a separate convert -crop command, but I'm not having any luck.

So for instance, I'm trying to composite a portion, 1920x50px portion of one image onto a full 1920x1080px image.

Ideas? Any help would be appreciated.

Phil

Re: composite from portion of another image.

Posted: 2010-07-06T18:35:44-07:00
by fmw42
see parenthesis processing and clones at http://www.imagemagick.org/Usage/basics/#parenthesis

something like:

convert image1 \( image2 -crop ... +repage \) -geometry +X+Y -compose ... -composite result

see also http://www.imagemagick.org/Usage/crop/#crop_repage

Re: composite from portion of another image.

Posted: 2010-07-06T20:16:53-07:00
by anthony
fmw42 wrote:see parenthesis processing and clones at http://www.imagemagick.org/Usage/basics/#parenthesis

Code: Select all

convert image1 \( image2 -crop ... +repage \) -geometry +X+Y -compose ... -composite result
Or using image layers, just replace the crop position with the position you want!

Code: Select all

  convert image1 \( image2 -crop ... -set page +X+Y \) -flatten  result