views:

23

answers:

2

I'm trying to create a watermark with ImageMagick however, the guides on layering are pretty daunting. Basically I'll have one base image say "base.jgp" and an overlay image say "overlay.jpg". Overlay.jpg would be smaller than base.jpg. Which exec command would I run to place overlay centered on top of base.jpg?

Thanks!

A: 

Check out ImageMagick examples, especially the Compositing Images chapter. It has a number of ready-made real-world examples.

Pekka
This is the daunting guide that I was referring to.
ThinkingInBits
@ThinkingInBits but it contains an example showing how to center an image on top of the other, doesn't it?
Pekka
A: 
shell_exec("composite -gravity center ./images/watermark_horizontal.png {$this->path} {$this->path}");

Here we go

ThinkingInBits