If you want to use php to add a background tile watermark to an image, you must use a php plug-in to add a background tile watermark to the image by using imagick, below we provide an instance code.
If you want to useAdd a background tile watermark to the image in the php tutorial.The effect is that a php plug-in must be used for an instance, that is, imagick can be used to add images.Background tile watermark EffectOh, here is an instance code.
Command Line Mode for imagemagic to remove image backgrounds:
Convert-size 140x80 xc: none-fill gray-gravity northwest-draw "text 'copyright'"-gravity southeast-draw "text 'copyright'" miff: -| composite-tile-logo.jpg wmark_text_tiled.jpg
Imagick code:
<? Php
$ Image = new imagick('logo.jpg ');
$ Im = new imagick ();
$ Im-> newimage (140, 80, new imagickpixel ("none "));
$ Draw = new imagickdraw ();
$ Draw-> setfillcolor (new imagickpixel ("gray "));
$ Draw-> setgravity (imagick: gravity_northwest );
$ Draw-> annotation (10, 10, 'copyright ');
$ Draw-> setgravity (imagick: gravity_southeast );
$ Draw-> annotation (5, 15, 'copyright ');
$ Im-> drawimage ($ draw );
$ Image = $ image-> textureimage ($ im );
$ Image-> compositeimage ($ image, imagick: composite_copy, 0, 0 );
Header ("content-type: image/{$ image-> getimageformat ()}");
$ Image-> writeimage('wmark_text_tiled.jpg ');
$ Image-> clear ();
$ Image-> destroy ();
?>
If your model has not been installed with php_imagick, download it as follows:
Http://pecl.php.net/package/imagick