Watermarking made simple -Imagick : Create and modify images : Graphics Image PHP Source Code


PHP Source Code » Graphics Image » Create and modify images »

 

Watermarking made simple -Imagick


<?php
/* Create Imagick object */
$im = new Imagick'example.png' );
/* Create a drawing object and set the font size */
$draw = new ImagickDraw();
$draw->setFontSize30 );
/* Make the watermark semi-transparent */
$draw->setFillAlpha0.4 );
/* Set gravity to the center. More about gravity:
    http://www.imagemagick.org/Usage/annotating/#gravity */
$draw->setGravityImagick::GRAVITY_CENTER );
/* Write the text on the image
    Position x0,y0 (Because gravity is set to center)
    Rotation 45 degrees.
*/
$im->annotateImage$draw0045"Copyright Example" );
/* Output */
header"Content-Type: image/{$im->getImageFormat()}" );
echo 
$im;
?>


HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Graphics Image
» Create and modify images