PHP uses GD library to implement image watermark and thumbnail image--add image watermark to Image

Source: Internet
Author: User

  

Today, to learn about the use of the PD library in PHP to achieve the image Watermark text watermark method, do not need PS Oh!

First, prepare the footage

(1) Prepare a picture

(2) Prepare a watermark (preferably transparent, i.e. the background is a white bottom)

(3) Prepare a font (in the computer C:\Windows\Fonts location, where you can find a copy of your favorite)

(4) Put all the above 3 steps in one folder (in the WWW folder directory)

This is my preparation!

(5) Open the GD library function (in the php.ini file, remove the preceding semicolon, restart the server)

1. Create a new PHP file (imageziti.php)

2. Steps (Four steps for each method)

Small steps to open a picture

(1)

(2)

Meaning of the getimagesize () function

(3)

Meaning of the image_type_to_extension () function

(4)

(5)

Small steps to manipulate pictures

(1)

(2)

Meaning of the Imagecopymerge () function

(3)

(4)

Effect

(5)

Effect

(6)

Overall code

                

 

END

RELATED links:

Add a text watermark to the original picture: http://www.cnblogs.com/finalanddistance/p/7239583.html

PHP uses GD library to implement image watermark and thumbnail image--add image watermark to Image

Related Article

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.