The php gd library cannot add watermarks to gif images. If you want to use php to add watermarks to gif images, you must use a PHP extension of the ImageMagick function, it can help us complete the functions we want.
The gd library in the php tutorial cannot add watermarks to gif images. If you want to use php to add watermarks to gif images, you must use a php extension of the imagemagick function, it can help us complete the functions we want.
<? Php
$ Imagedraw = new imagick ();
$ Pixel = new imagickpixel ('Gray ');
$ Pixel-> setcolor ('black ');
$ Imagedraw-> newimage (100, 75, $ 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.ii.'.gif ');
$ Thisimage-> annotateimage ($ draw, 0, 12, 0, 'copyright by mpeg ');
$ Animation-> addimage ($ thisimage );
$ Animation-> setimagedelay ($ delay );
}
Header ("content-type: image/gif ");
Echo $ animation-> getimagesblob ();
?>
Php extension of imagemagick function. With this extension, php can have the same functions as imagemagick. Imagemagick is a powerful, stable, and free toolkit that can be used to read, write, and process image files in over 185 basic formats, including popular tiff, jpeg, gif, png, pdf, and photocd. By using imagemagick, You can dynamically generate images based on the needs of web applications. You can also resize, rotate, sharpen, subtract, or add special effects to one or more images, save the operation results in the same format or other formats.
Components
Http://pecl.php.net/package/imagick
Http://www.imagemagick.org