16.1. Creating Dynamic Images

PHP supports many functions for generating or modifying images on-the-fly. These functions are mostly built on the GD library, which you can download from http://www.boutell.com/gd. In most binary distributions of PHP, the GD module is included. If you are compiling your binaries yourself, the GD module has to be enabled at compile time using --with-gd when running configure. In addition, support for JPG should be enabled.

After you have compiled PHP to your needs, you can start working with the module. In this section you will learn to perform all basic operations when working with images and you will also see how text can be processed efficiently.

16.1.1. Basic Operations

The first thing to do when generating a ...

Get PHP and PostgreSQL: Advanced Web Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.