Php adds a background tile watermark to the image. code _ PHP Tutorial

Source: Internet
Author: User
Php adds the background tile watermark code to the image. If you want to use php to add a background tile watermark to an image, you must use a php plug-in to use imagick, he can add a background tile watermark to the image. if you want to use php to add a background tile watermark to the image, you must use a php plug-in to use the image, he can add a background tile watermark to the image. here is an example 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:

$ 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

When adding a background tile watermark effect to an image, you must use a php plug-in to use imagick to add a background tile watermark effect to the image...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.