composite image from the center

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
jnimo

composite image from the center

Post by jnimo »

hello again, i have another question (sorry for bugging)


i am trying to make a composite of 2 images and i always use this type of command

composite -dissolve 100% -geometry +24+5 file1.png file2.png file3.png

but there is sometimes when i want to put a image over other one but the corner of the first is out of the coordinates of the second image. so i put it from the bottom right cordinates.

composite -dissolve 100% -geometry -24-5 file1.png file2.png file3.png

but there is now a new problem, when i try to put a image over a second image and ALL the corners are outside of the coordinate system (like when i try to put a image with rotation in the corner of the second image and all the corners are out of the system). there is a way to make a composite with the coordinate of the center of the top image, i mean, i can have that coordinate but i don't know how i can make the composite. someone could help me?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: composite image from the center

Post by Bonzo »

Replace -geometry with -gravity center

You can use both e.g. -gravity center -geometry +20+20 this will offset the image 20 x 20 from the center of the image.
jnimo

Re: composite image from the center

Post by jnimo »

yeah, but that put me in the center of the down image, i need to print with the center of the pot image, i don't know if i explain myself clear
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: composite image from the center

Post by Bonzo »

Have you tried to -trim your second image?

Otherwise a couple of example images would help.
jnimo

Re: composite image from the center

Post by jnimo »

thanks it works with that !!! :D
Post Reply