If you want to use PHP to add a background tiled watermark effect to an image, you must use a plug-in in PHP to give an example, that is, use imagick, which can add a background tiled watermark effect to an image. Below we provide an example code .
If you want to use the php tutorial to add the background tiled watermark effect to the image, you must use a plug-in in php to implement it, that is, use imagick, which can add the background tiled watermark to the image. EffectOh, we provide an example code below.
imagemagic official command line mode to remove image background:
convert -size 140x80 xc:none -fill gray -gravity northwest -draw "text 10,10 'copyright'" -gravity southeast -draw "text 5,15 'copyright'" - .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( "grey" ));
$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 installed php_imagick, please download it. The download address is as follows
http://pecl.php.net/package/imagick