XXIX. Image functions

You can use the image functions in PHP to get the size of JPEG, GIF, PNG, and SWF images, and if you have the GD library (available at http://www.boutell.com/gd/) you will also be able to create and manipulate images.

The format of images you are able to manipulate depend on the version of gd you install, and any other libraries gd might need to access those image formats. Versions of gd older than gd-1.6 support gif format images, and do not support png, where versions greater than gd-1.6 support png, not gif.

In order to read and write images in jpeg format, you will need to obtain and install jpeg-6b (available at ftp://ftp.uu.net/graphics/jpeg/), and then recompile gd to make use of jpeg-6b. You will also have to compile PHP with --with-jpeg-dir=/path/to/jpeg-6b.

To add support for Type 1 fonts, you can install t1lib (available at ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/pub/software/t1lib/), and then add --with-t1lib[=dir].

Table of Contents
GetImageSize — Get the size of a GIF, JPEG, PNG or SWF image
ImageArc — Draw a partial ellipse
ImageChar — Draw a character horizontally
ImageCharUp — Draw a character vertically
ImageColorAllocate — Allocate a color for an image
ImageColorDeAllocate — De-allocate a color for an image
ImageColorAt — Get the index of the color of a pixel
ImageColorClosest — Get the index of the closest color to the specified color
ImageColorExact — Get the index of the specified color
ImageColorResolve — Get the index of the specified color or its closest possible alternative
ImageGammaCorrect — Apply a gamma co