composite 2 images with gravity offset?

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
coreelements
Posts: 1
Joined: 2016-03-14T02:54:33-07:00
Authentication code: 1151

composite 2 images with gravity offset?

Post by coreelements »

Hi

I have this code

Code: Select all

/opt/ImageMagick/bin/composite  -dissolve 50 -gravity North 'image_1.png' 'image_2.png' -alpha Set 'output.png'
Wich works fine. It will combine 2 images where image_2 has a alpha of 50% and will be placed center north on top of image_1 and outputted to output.png.

Now I want to "offset" image_2 .. that means .. I still want it gravity north, but let's say offset -10px left or +20px right.

Any idea how to do this?

Greets
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: composite 2 images with gravity offset?

Post by Bonzo »

Try:

Code: Select all

/opt/ImageMagick/bin/composite  -dissolve 50 -gravity North -geometry -10+20 'image_1.png' 'image_2.png' -alpha Set 'output.png'
Post Reply