Page 1 of 1

Overlaying a rectangular logo

Posted: 2013-07-06T03:07:45-07:00
by markth
I have tried and tried and tried so many different ways to do something as simple as overlay a small image on a larger image. The larger is 1000 x 750 px. The smaller is 100 x 50 px. I need to position it in the bottom right hand corner and I'll be expletived if I can.

Can anyone offer me some guidance? I am using command line IM.

Re: Overlaying a rectangular logo

Posted: 2013-07-06T03:28:45-07:00
by Bonzo
Try:

Code: Select all

convert background.jpg watermark.png -gravity southeast -composite output.jpg

Re: Overlaying a rectangular logo

Posted: 2013-07-06T03:56:05-07:00
by markth
I had tried a few variants of that and tried it again and in situ it doesn't work. If I paste my full code here:

Code: Select all

C:\imagemagick\convert.exe "large.jpg" ( -background none -fill rgba(255,255,255,0.9) -size 3430x1973 caption:"caption text" ( +clone -shadow 80x6+1+1 ) +swap -layers merge -repage +428+284 ) ( -background none -fill rgba(255,255,255,0.9) -font "font.ttf" -size 1715.2x284.8 caption:"caption text" ( +clone -shadow 80x6+1+1 ) +swap -layers merge -repage +428.8+2400.864 ) ( "overlay.png" -gravity southeast -composite ) -layers merge "output.jpg"
I apologise if what I stated previously does not marry up with my code. I have incorporated your code just after "overlay.png" and it is not showing the overlay image. It does however work if I neglect the -gravity and -composite settings, and it prints the overlay in the top left corner.

I'm sure it's pretty simple where I am going wrong!

Re: Overlaying a rectangular logo

Posted: 2013-07-06T03:58:20-07:00
by markth
Pretty simple indeed - I was just putting the overlay code in the wrong place. I added it just before the final "output.jpg" and it's working well. Thank you very much Bonzo!