Server IP : 173.249.157.85 / Your IP : 216.73.216.232 Web Server : Apache System : Linux server.frogzhost.com 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : econtech ( 1005) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/cpanel/ea-php56/root/usr/share/doc/pecl/imagick/examples/
Current File : /opt/cpanel/ea-php56/root/usr/share/doc/pecl/imagick/examples/watermark.php
<?php
/*
Simple example of watermarking
*/
/* Create Imagick object */
$Imagick = new Imagick();
/* Create a drawing object and set the font size */
$ImagickDraw = new ImagickDraw();
$ImagickDraw->setFontSize( 50 );
/* Read image into object*/
$Imagick->readImage( '/tmp/test.jpg' );
/* Seek the place for the text */
$ImagickDraw->setGravity( Imagick::GRAVITY_CENTER );
/* Write the text on the image */
$Imagick->annotateImage( $ImagickDraw, 4, 20, 0, "Test Watermark" );
/* Set format to png */
$Imagick->setImageFormat( 'png' );
/* Output */
header( "Content-Type: image/{$Imagick->getImageFormat()}" );
echo $Imagick->getImageBlob();
?>