PHP image Processing

Source: Internet
Author: User

PHP image Processing

PHP provides a wealth of image processing functions, mainly including:

function Description
Gd_info () Get information about the currently installed GD Library
GetImageSize () Get image information
Getimagesizefromstring () Get image information
Image_type_to_extension () Get picture suffix
Image_type_to_mime_type () Returns the MIME type of an image
Image2wbmp () Output wbmp Pictures
Imageaffine () Returns an image after an affine transformation
Imageaffinematrixconcat () Connect two matrices
Imageaffinematrixget () Get matrix
Imagealphablending () To set the color blending mode of an image
Imageantialias () Whether to use anti-aliasing (antialias) feature
Imagearc () Draw an elliptical arc
Imagechar () Write horizontal characters
Imagecharup () To draw a character vertically
Imagecolorallocate () Assign a color to an image
Imagecolorallocatealpha () Assign color and transparency to an image
Imagecolorat () Gets the color index value of a pixel
Imagecolorclosest () Gets the index value of the color closest to the specified color
Imagecolorclosestalpha () Gets the index of the color closest to the specified color and transparency
IMAGECOLORCLOSESTHWB () Gets the black-white index of the closest chroma to the specified color
Imagesx (), Imagesy () Get image width and height
GD Library

With the PHP image processing function, the GD support library needs to be loaded. Make sure PHP.ini has the GD library loaded:

On the Window server:

Extension = Php_gd2.dll

On Linux and MAC systems:

Extension = php_gd2.so

Use the Gd_info () function to view information about the currently installed GD library:

<? PHP Var_dump (Gd_info ());? >

The output is roughly as follows:

Array(12) {  ["GD Version"]=>string(+) "bundled (2.1.0 compatible)"  ["FreeType Support"]=>BOOL (true)  ["FreeType Linkage"]=>string() "With FreeType"  ["T1lib Support"]=>BOOL (false)  ["GIF Read Support"]=>BOOL (true)  ["GIF Create Support"]=>BOOL (true)  ["JPEG Support"]=>BOOL (true)  ["PNG Support"]=>BOOL (true)  ["WBMP Support"]=>BOOL (true)  ["XPM Support"]=>BOOL (false)  ["XBM Support"]=>BOOL (true)  ["Jis-mapped Japanese Font support"]=>BOOL (false)}

PHP image Processing

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.