PHP is not limited to just producing HTML output. It can also create and manipulate image files in various formats, including GIF, PNG, JPG, WBMP, and XPM. Even more conveniently, PHP can directly output image streams to the browser. To process images, the GD library with image functions needs to be included when compiling PHP. Additionally, GD and PHP may require other libraries depending on which image formats need to be supported.
You can use image functions in PHP to obtain the dimensions of JPEG, GIF, PNG, SWF, TIFF, and JPEG2000 images.
**Note:** Refer to the requirements section to understand how to extend image capabilities for reading, writing, and modifying images, as well as reading metadata from photos taken by digital cameras.
If you have the GD library (available at http://www.boutell.com/gd/), you can create and manipulate images.
The image formats that can be handled depend on the version of GD installed, as well as any other libraries that GD might use to access these formats. GD versions below 1.6 support the GIF image format but do not support PNG, while versions above 1.6 support PNG but do not support GIF.
**Note:** Starting with PHP 4.3, a version of the GD library is bundled. This bundled version includes additional features such as alpha blending and should be preferred because it is better maintained and more stable.