Use PHP code to add watermarks to images
This article mainly introduces the use of PHP code to image watermark information, the need for friends can refer to the following
First look for a picture, renamed to Face.jpeg, create watermark.php:
?
1 2 3 4 5 6 7 8 9 10 11 12 |
/** * Created by Phpstorm. * User:administrator * DATE:2015/6/29 * time:22:27 */ $img = Imagecreatefromjpeg (' face.jpeg ');//create image based on existing JPG Header (' content-type:image/jpeg ');//Set MIME type Imagestring ($img, 5,5,5, ' vito-l ', Imagecolorallocate ($img, 255,0,0));//Generate watermark, imagestring (picture, font, position x, position y, string, color) Imagejpeg ($img);//Output picture The upper-left corner of the entire image is 0,0 |
The effect is as follows:
The above mentioned is the whole content of this article, I hope you can like.
http://www.bkjia.com/PHPjc/1025318.html www.bkjia.com true http://www.bkjia.com/PHPjc/1025318.html techarticle use PHP code to add a watermark to the picture This article mainly introduces the use of PHP code to image watermark related information, the need for friends can refer to the first to find a picture, renamed to Face.jpeg, Chong ...