PHP GD Library is not able to add watermarks to GIF images, if you want to use PHP to add watermark to GIF images, you have to rely on a imagemagick function of PHP extension, it can help us to complete the function we want oh.
PHP Tutorial GD Library is not able to add watermarks to GIF images, if you want to use PHP to add watermark to GIF images, you have to rely on a imagemagick function PHP extension, it can help us to complete the function we want oh.
!--? php
$imagedraw = new Imagick ();
$pixel = new Imagickpixel (' Gray ');
$pixel->setcolor (' black ');
$imagedraw->newimage ($pixel);
$draw = new Imagickdraw ();
$draw->setfont (' bookman-demiitalic ');
$draw->setfontsize (12);
$image =new Imagick ();
$animation = new Imagick ();
$animation->setformat ("gif");
$image->readimage ("Old.gif");
$unitl = $image->getimageindex ();
$image->writeimages (' Animation.gif ', false);
$delay = $image->getimagedelay ();
$filename = ' animation-';
for ($i =0; $i < $unitl; $i + +) {
$thisimage = new Imagick ();
$thisimage->readimage ($filename. $i. gif ');
$thisimage->annotateimage ($draw, 0, 0, ' Copyright by MPEG ');
$animation->addimage ($thisimage);
$animation->setimagedelay ($delay);
}
Header ("Content-type:image/gif");
Echo $animation->getimagesblob ();
?>
PHP extensions for ImageMagick functionality. Using this extension allows PHP to have the same functionality as ImageMagick. ImageMagick is a powerful, stable and free toolset and development package that can be used to read, write, and process image files in more than 185 basic formats, including popular TIFF, JPEG, GIF, PNG, PDF, and PHOTOCD formats. With ImageMagick, you can dynamically generate images based on the needs of your Web application, and you can resize, rotate, sharpen, subtract, or add effects to a (or a group of) images and save the results of the operation in the same format or other format.
Component Download Address
Http://pecl.php.net/package/imagick
http://www.imagemagick.org
http://www.bkjia.com/PHPjc/633009.html www.bkjia.com true http://www.bkjia.com/PHPjc/633009.html techarticle PHP GD Library is not able to add watermarks to GIF images, if you want to use PHP to add watermarks to GIF images, you have to rely on a imagemagick function of PHP extension, it can help us to complete we want to ...