PHP Action on Image Color

Source: Internet
Author: User
Tags transparent color

1.imagecolorallocate

Syntax: int imagecolorallocate (int im,int red,int green,int blue)

The function is to set the RGB mode color in the IM-represented image, the return value is an identity that uniquely determines the color of an IM image, and only the colors in a particular image are used by the modifier to be used by the image, and all practical colors in an image must be specified in such a way. And one image cannot use the color of another image

2.imagecolortransparent

Syntax: int imagecolortransparent (int im[,int col])

This function specifies the transparent background color for the image, Im is the identity of the image, col the color specified for the image using the Imagecolorallocate function, and the return value is the identity of the newly specified transparent color

3.imagecolorat

Syntax: int imagecolorat (int im,int x,int y)

This function can get the color value of the point-source element in the image. parameter IM is the logo of the graph, and X and Y are the horizontal and vertical coordinates of the points in the image respectively.

4.imagecolorclosest

Syntax: int imagecolorclosest (int im,int red,int green,int blue)

The function can calculate the color of a point in a given image and the index value of which color is closest, and the parameter IM is the identity of the image.

5.imagecoloeset

Syntax: bool Imagecolorset (int im,int index,int red,int green,int Blue)

This function can set the color of the specified index in the Color index table of the image. Index is the specified number

6.imagecolorsforindex

Syntax: array imagecolorsforindex (int im,int index)

The function gets the specified color from the element index table of the image according to the index number

7.imagecolorstotal

Syntax: int imagecolorstotal (int im)

This function can detect the total number of colors used in the 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.