This is gd 2.0.4.

gd 2.0.4

A graphics library for fast image creation

Follow this link to the latest version of this document.

HEY! READ THIS! gd 2.0.4 creates PNG, JPEG and WBMP images, not GIF images. This is a good thing. PNG is a more compact format, and full compression is available. JPEG works best with photographic images, and is still more compatible with the major Web browsers than even PNG is. WBMP is intended for wireless devices (not regular web browsers). Old code will need modification to call gdImagePng or gdImageJpeg instead of gdImageGif. Please do not ask us to send you the old GIF version of GD. Unisys holds a patent on the LZW compression algorithm, which is used in fully compressed GIF images. The best solution is to move to legally unencumbered, well-compressed, modern image formats such as PNG and JPEG as soon as possible.

gd 2.0.4 requires that the following libraries also be installed, in order to produce the related image formats:

libpng (see the libpng home page), if you want PNG

zlib (see the info-zip home page), if you want PNG

jpeg-6b or later, if desired (see the Independent JPEG Group home page), if you want JPEG

If you want to use the TrueType font support, you must also install the FreeType 2.x library, including the header files. See the Freetype Home Page, or SourceForge. No, I cannot explain why that site is down on a particular day, and no, I can't send you a copy.

If you want to use the Xpm color bitmap loading support, you must also have the X Window System and the Xpm library installed (Xpm is often included in modern X distributions). Most of the time you won't need Xpm.

Please read the documentation and install the required libraries. Do not send email asking why png.h is not found. Do not send email asking why libgd.so is not found, either. See the requirements section for more information. Thank you!

Table of Contents

Up to the Boutell.Com, Inc. Home Page

Credits and license terms

In order to resolve any possible confusion regarding the authorship of gd, the following copyright statement covers all of the authors who have required such a statement. If you are aware of any oversights in this copyright notice, please contact Thomas Boutell who will be pleased to correct them.

COPYRIGHT STATEMENT FOLLOWS THIS LINE
Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188 by the National Institutes of Health.

Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by Boutell.Com, Inc.

Portions relating to GD2 format copyright 1999, 2000, 2001, 2002 Philip Warner.

Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg Roelofs.

Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John Ellson (ellson@lucent.com).

Portions relating to gdft.c copyright 2001, 2002 John Ellson (ellson@lucent.com).

Portions relating to JPEG and to color quantization copyright 2000, 2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, Thomas G. Lane. This software is based in part on the work of the Independent JPEG Group. See the file README-JPEG.TXT for more information.

Portions relating to WBMP copyright 2000, 2001, 2002 Maurice Szmurlo and Johan Van den Brande.

Permission has been granted to copy, distribute and modify gd in any context without fee, including a commercial application, provided that this notice is present in user-accessible supporting documentation.

This does not affect your ownership of the derived work itself, and the intent is to assure proper credit for the authors of gd, not to interfere with your productive use of gd. If you have questions, ask. "Derived works" includes all programs that utilize the library. Credit must be given in user-accessible documentation.

This software is provided "AS IS." The copyright holders disclaim all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this code and accompanying documentation.

Although their code does not appear in gd 2.0.4, the authors wish to thank David Koblas, David Rowley, and Hutchison Avenue Software Corporation for their prior contributions.

END OF COPYRIGHT STATEMENT

What is gd?

gd is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and write out the result as a PNG or JPEG file. This is particularly useful in World Wide Web applications, where PNG and JPEG are two of the formats accepted for inline images by most browsers.

gd is not a paint program. If you are looking for a paint program, you are looking in the wrong place. If you are not a programmer, you are looking in the wrong place, unless you are installing a required library in order to run an application.

gd does not provide for every possible desirable graphics operation. It is not necessary or desirable for gd to become a kitchen-sink graphics package, but version 2.0 does include most frequently requested features, including both truecolor and palette images, resampling (smooth resizing of truecolor images) and so forth.

What if I want to use another programming language?

Not all of these tools are necessarily up to date and fully compatible with 2.0.4.

Perl

gd can also be used from Perl, courtesy of Lincoln Stein's GD.pm library, which uses gd as the basis for a set of Perl 5.x classes. Highly recommended.

Tcl

gd can be used from Tcl with John Ellson's Gdtclft dynamically loaded extension package.

Pascal

Pascal enthusiasts should look into Michael Bradbury's gdfp package.

REXX

A gd interface for the REXX language is available.

Any Language

The "fly" interpreter performs gd operations specified in a text file. You can output the desired commands to a simple text file from whatever scripting language you prefer to use, then invoke the interpreter.

What's new in version 2.0.4?

The following contributions from John Ellson: And the following additional fixes:

What's new in version 2.0.3?