$image = new Imagick();
$image->readImage($source);
// Open the watermark
$watermark = new Imagick();
$watermark->readImage($logo);
// Overlay the watermark on the original image (bottom - right, margin: 5px)
$image->compositeImage($watermark, imagick::COMPOSITE_OVER, $image->getImageWidth() - $watermark->getImageWidth() -5, $image->getimageheight() - $watermark->getImageHeight() - 5);
// send the result to the browser
header("Content-Type: image/" . $image->getImageFormat());
echo $image;
Title:
PHP Imagick - Watermark images
Description:
$image = new Imagick(); $image->readImage($source); // Open the watermark $watermark = new Imagick(); $watermark->readImage($logo...
...
Rating:
4