Overlaying a rectangular logo

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
markth
Posts: 9
Joined: 2013-06-19T03:47:53-07:00
Authentication code: 6789

Overlaying a rectangular logo

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Overlaying a rectangular logo

Post by Bonzo »

Try:

Code: Select all

convert background.jpg watermark.png -gravity southeast -composite output.jpg
markth
Posts: 9
Joined: 2013-06-19T03:47:53-07:00
Authentication code: 6789

Re: Overlaying a rectangular logo

Post 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!
markth
Posts: 9
Joined: 2013-06-19T03:47:53-07:00
Authentication code: 6789

Re: Overlaying a rectangular logo

Post 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!
Post Reply