Dear Friends,
I want to superimpose two images, second image is 25% resized of original only. Now each time I try to superimpose, it does it with center alignment only. I want to offset it by few pixels. I had tried geometry switch but it is not working for me. Surely I am missing something somewhere please guide me.
Code : In which I am passing file name with %1
convert %1 -resize 25%% r_%1
convert %1 r_%1 -compose Multiply -gemometry -50 -50 -composite n_%1
Super impose
-
- Posts: 26
- Joined: 2011-02-08T04:37:21-07:00
- Authentication code: 8675308
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Super impose
do not separate -compose ... -composite, put the -geometry before the -composeconvert %1 r_%1 -compose Multiply -gemometry -50 -50 -composite n_%1
also no space between coordinate offsets in -geometry
try
convert %1 r_%1 -gemometry -50-50 -compose Multiply -composite n_%1
or if you want it centered
convert %1 r_%1 -gravity center -gemometry -50-50 -compose Multiply -composite n_%1
-
- Posts: 26
- Joined: 2011-02-08T04:37:21-07:00
- Authentication code: 8675308
Re: Super impose
Thank you for reply.
My image is of 337x337 and second image is of 84x84 and I want to shift second image by 34 pxl vertically down and super impose. Than which coordinate should I give, can you please elaborate calculation to derive pixel to be given
My image is of 337x337 and second image is of 84x84 and I want to shift second image by 34 pxl vertically down and super impose. Than which coordinate should I give, can you please elaborate calculation to derive pixel to be given
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Super impose
I assume that %1 is the big image and r_%1 is the smaller image to be put on top of the larger image. If the other way, then switch the two input images.
If relative to the top left:
convert %1 r_%1 -geometry -0-37 -compose over -composite n_%1
If relative to the center:
convert %1 r_%1 -gravity center -geometry -0-37 -compose over -composite n_%1
see http://www.imagemagick.org/Usage/layers/#convert
If relative to the top left:
convert %1 r_%1 -geometry -0-37 -compose over -composite n_%1
If relative to the center:
convert %1 r_%1 -gravity center -geometry -0-37 -compose over -composite n_%1
see http://www.imagemagick.org/Usage/layers/#convert