Commits

pierre  committed ed93542

- sync to 1.6.0

  • Participants
  • Parent commits 0b6804e

Comments (0)

Files changed (5)

+990715 Thomas Boutell (TBB)
+
+Removed all GIF capability in favor of PNG
+in order to remove any possible LZW patent concerns.
+
+990701 Philip Warner (pjw) as documented by TBB
+
+Implemented gdImageSink (missing in initial 1.5 release),
+renamed all new source files to have a gd_ prefix.
+
 990628 Thomas Boutell (TBB)
 
 Removed all C++ style comments for broader compatibility.

File src/Makefile

 CC=gcc 
 AR=ar
 #CFLAGS= -ggdb
-CFLAGS= -O 
-LIBS=-L. -lgd -lz -lm
+CFLAGS= -g 
+LIBS=-L. -lgd -lz -lm -lpng
 
-all: libgd.a gdtest gddemo giftolzw giftogd giftogd2 gdtogif gd2togif gd2tolzw gd2copypal gdparttogif gd2time webgif
+all: libgd.a gdtest gddemo pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng gd2time webpng
 
 gdtest:	gdtest.o libgd.a gd.h
 	$(CC) gdtest.o -o gdtest        $(LIBS)
 gddemo: gddemo.o libgd.a gd.h gdfonts.h gdfontl.h
 	$(CC) gddemo.o -o gddemo	$(LIBS)
 
-giftogd: giftogd.o libgd.a gd.h
-	$(CC) giftogd.o -o giftogd	$(LIBS) 
+pngtogd: pngtogd.o libgd.a gd.h
+	$(CC) pngtogd.o -o pngtogd	$(LIBS) 
 
-giftogd2: giftogd2.o libgd.a gd.h
-	$(CC) giftogd2.o -o giftogd2      $(LIBS)
+pngtogd2: pngtogd2.o libgd.a gd.h
+	$(CC) pngtogd2.o -o pngtogd2      $(LIBS)
 
-gdtogif: gdtogif.o libgd.a gd.h
-	$(CC) gdtogif.o -o gdtogif      $(LIBS)
+gdtopng: gdtopng.o libgd.a gd.h
+	$(CC) gdtopng.o -o gdtopng      $(LIBS)
 
-giftolzw: giftolzw.o libgd.a gd.h
-	$(CC) giftolzw.o -o giftolzw      $(LIBS)
-
-gd2togif: gd2togif.o libgd.a gd.h
-	$(CC) gd2togif.o -o gd2togif      $(LIBS)
-
-gd2tolzw: gd2tolzw.o libgd.a gd.h
-	$(CC) gd2tolzw.o -o gd2tolzw      $(LIBS)
+gd2topng: gd2topng.o libgd.a gd.h
+	$(CC) gd2topng.o -o gd2topng      $(LIBS)
 
 gd2copypal: gd2copypal.o libgd.a gd.h
 	$(CC) gd2copypal.o -o gd2copypal      $(LIBS)
 
-gdparttogif: gdparttogif.o libgd.a gd.h
-	$(CC) gdparttogif.o -o gdparttogif      $(LIBS)
+gdparttopng: gdparttopng.o libgd.a gd.h
+	$(CC) gdparttopng.o -o gdparttopng      $(LIBS)
 
 gd2time: gd2time.o libgd.a gd.h
 	$(CC) gd2time.o -o gd2time      $(LIBS)
 
-libgd.a: gd.o io.o io_file.o io_dp.o io_ss.o gd_gif_in.o gd_gif_out.o gd_lzw_out.o gd_gd.o gd_gd2.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
+libgd.a: gd.o gd_io.o gd_io_file.o gd_io_dp.o gd_io_ss.o gd_png.o gd_ss.o \
+	gd_gd.o gd_gd2.o gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
 	gd.h gdfontt.h gdfonts.h gdfontmb.h gdfontl.h gdfontg.h
 	rm -f libgd.a
-	$(AR) rc libgd.a gd.o io.o io_file.o io_dp.o gd_gif_in.o gd_gif_out.o gd_lzw_out.o gd_gd.o gd_gd2.o gdfontt.o gdfonts.o gdfontmb.o \
-		gdfontl.o gdfontg.o
+	$(AR) rc libgd.a gd.o gd_io.o gd_io_file.o gd_io_dp.o gd_io_ss.o \
+		gd_png.o gd_ss.o gd_gd.o gd_gd2.o \
+		gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o
 
-webgif: webgif.o libgd.a gd.h
-	$(CC) webgif.o -o webgif	$(LIBS)
+webpng: webpng.o libgd.a gd.h
+	$(CC) webpng.o -o webpng	$(LIBS)
 
 clean:
-	rm -f *.o *.a gddemo gdtest giftogd giftogd2 giftolzw gdtogif gd2togif gd2tolzw gdparttogif gd2time gd2copypal webgif 
+	rm -f *.o *.a gddemo gdtest pngtogd pngtogd2 gdtopng gd2topng gdparttopng gd2time gd2copypal webpng 
 

File src/demoout.png

Added
New image

File src/index.html

 <HTML>
 <HEAD>
-<TITLE>gd 1.5</TITLE>
+<TITLE>gd 1.6</TITLE>
 </HEAD>
 <BODY>
-<H1>gd 1.5</H1>
-<H2>A graphics library for fast GIF creation</H2>
+<H1>gd 1.6</H1>
+<H2>A graphics library for fast image creation</H2>
 <H2>Follow this link to the
 <A HREF="http://www.boutell.com/gd/">latest version
 of this document</A>.</H2>
 <H3>Table of Contents</H3>
 <UL>
 <LI><A HREF="#notice">Credits and license terms</A>
-<LI><A HREF="#whatsnew1.5">What's new in version 1.5?</A>
+<LI><A HREF="#whatsnew1.6">What's new in version 1.6?</A>
 <LI><A HREF="#whatis">What is gd?</A>
 <LI><A HREF="#gdother">What if I want to use another programming language?</A>
 <LI><A HREF="#required">What else do I need to use gd?</A>
 COPYRIGHT STATEMENT FOLLOWS THIS LINE
 </pre>
 <blockquote>
-Portions copyright 1994, 1995, 1996, 1997, 1998, by Cold Spring
+
+Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, by Cold Spring
 Harbor Laboratory. Funded under Grant P41-RR02188 by the National
 Institutes of Health.
 <P>
-Portions copyright 1996, 1997, 1998, by Boutell.Com, Inc.
-<p>
-GIF decompression code copyright 1990, 1991, 1993, by David Koblas
-(koblas@netcom.com).
-<p>
-Non-LZW-based GIF compression code copyright 1998, by Hutchison Avenue
-Software Corporation (<a href="http://www.hasc.com">http://www.hasc.com/</a>,
-info@hasc.com).
-<p>LZW-based GIF compression code David Rowley. This code is compiled
-only if the compiler macro LZW_LICENCED is defined when gd is built.
-Obtaining a license for the Unisys LZW compression patent is
-entirely between the user and Unisys. The authors of gd can provide
-NO assistance in this matter.
+Portions copyright 1996, 1997, 1998, 1999, by Boutell.Com, Inc.
 <p>
 Portions relating to GD2 format copyright 1999 Philip Warner.
 <p>
 documentation.  This software is provided "as is" without express or
 implied warranty.
 <p>
+Although their code does not appear in gd 1.6, the authors wish to 
+thank David Koblas, David Rowley, and Hutchison Avenue Software 
+Corporation for their prior contributions.
+<p>
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted, provided
+that the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation. <strong>This software is provided "AS IS."</strong>
+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.
 </blockquote>
 <pre>
 END OF COPYRIGHT STATEMENT
 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 .GIF file. This is particularly
-useful in World Wide Web applications, where .GIF is the
-format used for inline images.
+write out the result as a .PNG file. This is particularly
+useful in World Wide Web applications, where .PNG is one
+of the formats accepted for inline images by most browsers.
 <P>
 gd is not a paint program.
 If you are looking for a paint program, you are looking in
 <P>
 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 1.3 incorporates
+a kitchen-sink graphics package, but version 1.6 incorporates
 most of the commonly requested features for an 8-bit 2D package.
-Support for scalable fonts, and truecolor images, JPEG and PNG
-is planned for version 2.0. Version 1.3 was released to correct
-longstanding bugs and provide an LZW-free GIF compression routine.
+Support for scalable fonts, and truecolor images, JPEG and 
+truecolor PNG is planned for version 2.0.
 <P>
 <A NAME="gdother"><H3>What if I want to use another programming
 language?</h3></A>
 Lincoln Stein's
 <a href="http://www-genome.wi.mit.edu/ftp/pub/software/WWW/GD.html">
 GD.pm</a> library, which uses gd as the basis for a set of
-Perl 5.x classes. GD.pm is based on gd 1.1.1 but gd 1.2 should
+Perl 5.x classes. Not yet updated for gd 1.6.
 be compatible.
 <h4>Any Language</h4>
 There are, at the moment, at least three simple interpreters that
 text file from whatever scripting language you prefer to use, then
 invoke the interpreter.
 <p>
-These packages are based on gd 1.2 as of this writing but should
-be compatible with gd 1.3x with minimal tweaking.
+These packages have not been updated to gd 1.6 as of this writing.
 <ul>
 <li><a href="http://s27w007.pswfs.gov/tgd/">tgd</a>, by Bradley K. Sherman
 <li><a href="http://www.unimelb.edu.au/fly/fly.html">fly</a>, by Martin Gleeson
 </ul>
+<P><A NAME="whatsnew1.6"><H3>What's new in version 1.6?</H3></A>
+Version 1.6 features the following changes:
+<p>
+<strong>Support for 8-bit palette PNG images has been added.
+Support for GIF has been removed.</strong> This step was taken
+to completely avoid the legal controversy regarding the LZW
+compression algorithm used in GIF. Unisys holds a patent which
+is relevant to LZW compression. PNG is a superior image format
+in any case. Now that PNG is supported by both Microsoft
+Internet Explorer and Netscape (in their recent releases),
+we highly recommend that GD users upgrade in order to get 
+well-compressed images in a format which is legally unemcumbered.
 
 <P><A NAME="whatsnew1.5"><H3>What's new in version 1.5?</H3></A>
 
-Version 1.5 features the following changes:
+Version 1.5 featured the following changes:
 
 <dl>
 <dt><b>New GD2 format</b>
 <dd>      The new gdImage*Ptr function returns the chosen format stored in a block of memory.
           This can be directly used by the GD perl module.
 <p>
-<dt><b>LZW-based GIF compression code available for Unisys licensees</b>
-<dd>      Parties holding a legitimate license to use the patented
-LZW compression algorithm can produce smaller GIFs if the compiler 
-macro LZW_LICENCED is defined when gd is built. Obtaining a license for the 
-Unisys LZW compression patent is entirely between the user and Unisys. 
-The authors of gd can provide NO assistance in this matter.
 <dt><b>Added functions</b>
 <dd>gdImageCreateFromGd2Part - allows retrieval of part of an image (good for huge images, like maps),
 <br>gdImagePaletteCopy - Copies a palette from one image to another, doing it's best to match the colors in the target image to the colors in the source palette.
 <br>gdImageGd2, gdImageCreateFromGd2 - Support for new format
-<br>gdImageLzw - Optional support for LZW (for those who have a licence). Disabled by default.
 <br>gdImageCopyMerge - Merges two images (useful to highlight part of an image)
 <br>gdImageCopyMergeGray - Similar to gdImageCopyMerge, but tries to preserve source image hue.
-<br>gdImageGifPtr, gdImageLzwPtr, gdImageGdPtr, gdImageGd2Ptr - return memort blocks for each type of image.
-<br>gdImageCreateFromGifCtx, gdImageCreateFromGdCtx, gdImageCreateFromGd2Ctx, gdImageCreateFromGd2PartCtx - Support for new I/O context.
+<br>gdImagePngPtr, gdImageGdPtr, gdImageGd2Ptr - return memort blocks for each type of image.
+<br>gdImageCreateFromPngCtx, gdImageCreateFromGdCtx, gdImageCreateFromGd2Ctx, gdImageCreateFromGd2PartCtx - Support for new I/O context.
 
 </dl>
 
 <dt>Support for alternate data sources
 <dd>Programmers who wish to load a GIF from something other
 than a stdio FILE * stream can use the new
-<a href="#gdImageCreateFromGifSource">gdImageCreateFromGifSource</a> function.
+<a href="#gdImageCreateFromPngSource">gdImageCreateFromPngSource</a> function.
 <dt>Support for alternate data destinations
 <dd>Programmers who wish to write a GIF to something other
 than a stdio FILE * stream can use the new
-<a href="#gdImageGifToSink">gdImageGifToSink</a> function.
+<a href="#gdImagePngToSink">gdImagePngToSink</a> function.
 <dt>More tolerant when reading GIFs
 <dd>
 Version 1.4 does not crash when reading certain animated GIFs,
 <dl>
 <dt>Non-LZW-based GIF compression code
 <dd>
-Version 1.3 contains GIF compression code that uses simple Run Length
+Version 1.3 contained GIF compression code that uses simple Run Length
 Encoding instead of LZW compression, while still retaining compatibility
 with normal LZW-based GIF decoders (your browser will still like your GIFs).
-<strong>LZW compression is patented by Unisys. This is why there have
-been no new versions of gd for a long time. THANKS to
+<strong>LZW compression is patented by Unisys. We are currently reevaluating
+the approach taken by gd 1.3. The current release of gd does not support
+this approach. We recommend that you use the current release, and generate
+PNG images.</strong> Thanks to 
 Hutchison Avenue Software Corporation for contributing
-this code. THE NEW CODE PRODUCES LARGER GIFS AND IS NOT WELL
-SUITED TO PHOTOGRAPHIC IMAGES. THIS IS A LEGAL ISSUE.
-IT IS NOT A QUESTION OF TECHNICAL SKILL. PLEASE DON'T
-COMPLAIN ABOUT THE SIZE OF GIF OUTPUT. THANKS!</strong>
+the RLE GIF code.
 <dt>8-bit fonts, and 8-bit font support
 <dd>This improves support for European languages. Thanks are due
 to Honza Pazdziora <adelton@informatics.muni.cz> and also to
 gcc is free, ANSI compliant and a de facto industry standard.
 Ask your ISP why it is missing.</strong>
 <P>
-As of version 1.5, you also need the zlib compression library.
-It is available for a variety of platforms from
-<a href=http://www.cdrom.com/pub/infozip/zlib/>the zlib web site</a>.
+As of version 1.6, you also need the zlib compression library,
+and the libpng library. 
+zlib is available for a variety of platforms from
+<a href="http://www.cdrom.com/pub/infozip/zlib/">the zlib web site</a>.
+libpng is available for a variety of platforms from
+<a href="http://www.cdrom.com/pub/png/">the PNG web site</a>.
 <P>
-You will also want a GIF viewer, if you do not already have
+You will also want a PNG viewer, if you do not already have
 one for your system, since you will need a good way to check the
-results of your work. Any web browser will work, but you might
-be happier with a package like Lview Pro for Windows or
-xv for X. There are GIF viewers available for every graphics-capable
-computer out there, so consult newsgroups relevant to
-your particular system.
+results of your work. Netscape 4.04 and higher, and Microsoft
+Internet Explorer 4.0 or higher, both support PNG.
+For some purposes you might be happier with a package like 
+Lview Pro for Windows or xv for X. There are PNG viewers available 
+for every graphics-capable modern operating system, so consult 
+newsgroups relevant to your particular system.
 <P>
 <A NAME="getgd"><H3>How do I get gd?</H3></A>
 <h4>By HTTP</h4>
 <ul>
-<li><a href="http://www.boutell.com/gd/http/gd1.5.tar.gz">Gzipped Tar File (Unix)</a>
-<li><a href="http://www.boutell.com/gd/http/gd15.zip">.ZIP File (Windows)</a>
+<li><a href="http://www.boutell.com/gd/http/gd1.6.tar.gz">Gzipped Tar File (Unix)</a>
+<li><a href="http://www.boutell.com/gd/http/gd16.zip">.ZIP File (Windows)</a>
 </ul>
 <h4>By FTP</h4>
 <ul>
-<li><a href="ftp://ftp.boutell.com/pub/boutell/gd/gd1.5.tar.gz">Gzipped Tar File (Unix)</a>
-<li><a href="ftp://ftp.boutell.com/pub/boutell/gd/gd15.zip">.ZIP File (Windows)</a>
+<li><a href="ftp://ftp.boutell.com/pub/boutell/gd/gd1.6.tar.gz">Gzipped Tar File (Unix)</a>
+<li><a href="ftp://ftp.boutell.com/pub/boutell/gd/gd16.zip">.ZIP File (Windows)</a>
 </ul>
 <P>
 <A NAME="buildgd"><H3>How do I build gd?</H3></A>
 consult with an experienced user of your system. Sorry, we cannot
 answer questions about basic Internet skills.
 <p>
-Unpacking the archive will produce a directory called "gd1.5".
+Unpacking the archive will produce a directory called "gd1.6".
 <p>
 <h4>For Unix</h4>
-<code>cd</code> to the gd1.5 directory and examine the Makefile, which
+<code>cd</code> to the gd1.6 directory and examine the Makefile, which
 you will probably need to change slightly depending on your operating
 system and your needs.
 <h4>For Windows, Mac, Et Cetera</h4>
 "gddemo".
 <P>
 gddemo should execute without incident, creating the file
-demoout.gif. (Note there is also a file named demoin.gif,
+demoout.png. (Note there is also a file named demoin.png,
 which is provided in the package as part of the demonstration.)
 <P>
-Display demoout.gif in your GIF viewer. The image should
+Display demoout.png in your PNG viewer. The image should
 be 128x128 pixels and should contain an image of the
 space shuttle with quite a lot of graphical elements drawn
 on top of it.
 <P>
-(If you are missing the demoin.gif file, the other items
+(If you are missing the demoin.png file, the other items
 should appear anyway.)
 <P>
-Look at demoin.gif to see the original space shuttle
+Look at demoin.png to see the original space shuttle
 image which was scaled and copied into the output image.
 <P>
 <A NAME="basics"><H3>gd basics: using gd in your program</H3></A>
-gd lets you create GIF images on the fly. To use gd in your
+gd lets you create PNG images on the fly. To use gd in your
 program, include the file gd.h, and link with the libgd.a
 library produced by "make libgd.a", under Unix. Under other
 operating systems you will add gd.c to your own project.
 /* Bring in gd library functions */
 #include "gd.h"
 
-/* Bring in standard I/O so we can output the GIF to a file */
+/* Bring in standard I/O so we can output the PNG to a file */
 #include &lt;stdio.h&gt;
 
 int main() {
 
 	/* Open a file for writing. "wb" means "write binary", important
 		under MSDOS, harmless under Unix. */
-	out = fopen("test.gif", "wb");
+	out = fopen("test.png", "wb");
 
 	/* Output the image to the disk file. */
-	<A HREF="#gdImageGif">gdImageGif</A>(im, out);	
+	<A HREF="#gdImagePng">gdImagePng</A>(im, out);	
 
 	/* Close the file. */
 	fclose(out);
 When executed, this program creates an image, allocates
 two colors (the first color allocated becomes the background
 color), draws a diagonal line (note that 0, 0 is the upper
-left corner), writes the image to a GIF file, and
+left corner), writes the image to a PNG file, and
 destroys the image.
 <P>
 The above example program should
 in the following reference chapters, complete with code
 snippets demonstrating each. There is also an
 <A HREF="#index">alphabetical index</A>.
-<H3><A NAME="webgif">Webgif: a more powerful gd example</A></H3>
-Webgif is a simple utility program to manipulate GIFs from the
+<H3><A NAME="webpng">Webpng: a more powerful gd example</A></H3>
+Webpng is a simple utility program to manipulate PNGs from the
 command line. It is written for Unix and similar command-line
 systems, but should be easily adapted for other environments.
-Webgif allows you to set transparency and interlacing and
-output interesting information about the GIF in question.
+Webpng allows you to set transparency and interlacing and
+output interesting information about the PNG in question.
 <P>
-webgif.c is provided in the distribution. Unix users can
-simply type "make webgif" to compile the program. Type
-"webgif" with no arguments to see the available options.
+webpng.c is provided in the distribution. Unix users can
+simply type "make webpng" to compile the program. Type
+"webpng" with no arguments to see the available options.
 <H2><A NAME="reference">Function and type reference</A></H2>
 <UL>
 <LI><A HREF="#types">Types</A></LI>
         void *context;
 } gdSource, *gdSourcePtr;
 </pre>
-Represents a source from which a GIF can be read.
-Programmers who do not wish to read GIFs from a file can provide
+Represents a source from which a PNG can be read.
+Programmers who do not wish to read PNGs from a file can provide
 their own alternate input mechanism, using the
-<a href="#gdImageCreateFromGifSource">gdImageCreateFromGifSource</a> function.
+<a href="#gdImageCreateFromPngSource">gdImageCreateFromPngSource</a> function.
 See the documentation of that function for an example of the
 proper use of this type.
 <DT><A NAME="gdSink">gdSink</A> <strong>(TYPE)</strong>
         void *context;
 } gdSink, *gdSinkPtr;
 </PRE>
-Represents a "sink" (destination) to which a GIF can be written.
-Programmers who do not wish to write GIFs to a file can provide
+Represents a "sink" (destination) to which a PNG can be written.
+Programmers who do not wish to write PNGs to a file can provide
 their own alternate output mechanism, using the
-<a href="#gdImageGifToSink">gdImageGifToSink</a> function.
+<a href="#gdImagePngToSink">gdImagePngToSink</a> function.
 See the documentation of that function for an example of the
 proper use of this type.
 <H3><A NAME="creating">Image creation, destruction, loading and saving</A></H3>
 /* ... Use the image ... */
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
 </PRE>
-<DT><A NAME="gdImageCreateFromGif">gdImageCreateFromGif(FILE *in)</A>
+<DT><A NAME="gdImageCreateFromPng">gdImageCreateFromPng(FILE *in)</A>
 <strong>(FUNCTION)</strong>
-<BR><A NAME="gdImageCreateFromGifCtx">gdImageCreateFromGifCtx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
+<BR><A NAME="gdImageCreateFromPngCtx">gdImageCreateFromPngCtx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
 <strong>(FUNCTION)</strong>
 <p>
 <DD>
-gdImageCreateFromGif is called to load images from GIF format files.
-Invoke gdImageCreateFromGif with an already opened pointer to a file
+gdImageCreateFromPng is called to load images from PNG format files.
+Invoke gdImageCreateFromPng with an already opened pointer to a file
 containing the desired image.
-gdImageCreateFromGif
+gdImageCreateFromPng
 returns a <A HREF="#gdImagePtr">gdImagePtr</A> to the new image, or NULL
 if unable to load the image (most often because the file is corrupt or
-does not contain a GIF image). gdImageCreateFromGif does <em>not</em>
+does not contain a PNG image). gdImageCreateFromPng does <em>not</em>
 close the file. You can inspect the sx and sy members of the
 image to determine its size. The image must eventually be destroyed
 using <A HREF="#gdImageDestroy">gdImageDestroy()</A>.
 <A HREF="#gdImagePtr">gdImagePtr</A> im;
 ... inside a function ...
 FILE *in;
-in = fopen("mygif.gif", "rb");
-im = gdImageCreateFromGif(in);
+in = fopen("mypng.png", "rb");
+im = gdImageCreateFromPng(in);
 fclose(in);
 /* ... Use the image ... */
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
 </PRE>
-<DT><A NAME="gdImageCreateFromGifSource">gdImageCreateFromGifSource(gdSourcePtr in)</A>
+<DT><A NAME="gdImageCreateFromPngSource">gdImageCreateFromPngSource(gdSourcePtr in)</A>
 <strong>(FUNCTION)</strong>
 <dd>
-gdImageCreateFromGifSource is called to load a GIF from
+gdImageCreateFromPngSource is called to load a PNG from
 a data source other than a file. Usage is very similar to
-the <a href="#gdImageCreateFromGif">gdImageCreateFromGif</a> function,
+the <a href="#gdImageCreateFromPng">gdImageCreateFromPng</a> function,
 except that the programmer provides a custom data source.
 <p>
 The programmer must write an input function which accepts
 programmer.
 <p>
 The example below
-implements <a href="#gdImageCreateFromGif">gdImageCreateFromGif</a>
-by creating a custom data source and invoking gdImageCreateFromGifSource.
+implements <a href="#gdImageCreateFromPng">gdImageCreateFromPng</a>
+by creating a custom data source and invoking gdImageCreateFromPngSource.
 <pre>
 static int freadWrapper(void *context, char *buf, int len);
 
-gdImagePtr gdImageCreateFromGif(FILE *in)
+gdImagePtr gdImageCreateFromPng(FILE *in)
 {
         gdSource s;
         s.source = freadWrapper;
         s.context = in;
-        return gdImageCreateFromGifSource(&s);
+        return gdImageCreateFromPngSource(&s);
 }
 
 static int freadWrapper(void *context, char *buf, int len)
 with an already opened pointer to a file containing the desired image
 in the <A HREF="#gdformat">gd file format</A>, which is specific to
 gd and intended for very fast loading. (It is <em>not</em> intended for
-compression; for compression, use GIF.)
+compression; for compression, use PNG.)
 gdImageCreateFromGd
 returns a <A HREF="#gdImagePtr">gdImagePtr</A> to the new image, or NULL
 if unable to load the image (most often because the file is corrupt or
 /* Now destroy it */
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
 </PRE>
-<DT><A NAME="gdImageGif">
-void gdImageGif(gdImagePtr im, FILE *out)</A>
+<DT><A NAME="gdImagePng">
+void gdImagePng(gdImagePtr im, FILE *out)</A>
 <STRONG>(FUNCTION)</STRONG>
 <DD>
-gdImageGif outputs the specified image to the specified
-file in GIF format. The file must be open for writing. Under MSDOS
+gdImagePng outputs the specified image to the specified
+file in PNG format. The file must be open for writing. Under MSDOS
 and all versions of Windows, it is important to use "wb" as opposed
 to simply "w" as the mode when opening the file, and under Unix there
-is no penalty for doing so. gdImageGif does <em>not</em>
+is no penalty for doing so. gdImagePng does <em>not</em>
 close the file; your code must do so.
 <PRE>
 ... inside a function ...
 /* Draw rectangle */
 <A HREF="#gdImageRectangle">gdImageRectangle</A>(im, 0, 0, 99, 99, black);
 /* Open output file in binary mode */
-out = fopen("rect.gif", "wb");
-/* Write GIF */
-gdImageGif(im, out);
+out = fopen("rect.png", "wb");
+/* Write PNG */
+gdImagePng(im, out);
 /* Close file */
 fclose(out);
 /* Destroy image */
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
 </PRE>
 
-<DT><A NAME="gdImageGifPtr">
-void* gdImageGifPtr(gdImagePtr im, int *size)</A>
+<DT><A NAME="gdImagePngPtr">
+void* gdImagePngPtr(gdImagePtr im, int *size)</A>
 <STRONG>(FUNCTION)</STRONG>
-<DD>Identical to gdImageGif except that it returns a pointer to a memory
-area with the GIF data. This memory must be freed by the caller when it is
+<DD>Identical to gdImagePng except that it returns a pointer to a memory
+area with the PNG data. This memory must be freed by the caller when it is
 no longer needed. The 'size' parameter received the total size of the block
 of memory.
 
-<DT><A NAME="gdImageGifToSink">gdImageGifToSink(gdImagePtr im, gdSinkPtr out)</A>
+<DT><A NAME="gdImagePngToSink">gdImagePngToSink(gdImagePtr im, gdSinkPtr out)</A>
 <strong>(FUNCTION)</strong>
 <dd>
-gdImageGifToSink is called to write a GIF to
+gdImagePngToSink is called to write a PNG to
 a data "sink" (destination) other than a file. Usage is very similar to
-the <a href="#gdImageGif">gdImageGif</a> function,
+the <a href="#gdImagePng">gdImagePng</a> function,
 except that the programmer provides a custom data sink.
 <p>
 The programmer must write an output function which accepts
 programmer.
 <p>
 The example below
-implements <a href="#gdImageGif">gdImageGif</a>
-by creating a custom data source and invoking gdImageGifFromSink.
+implements <a href="#gdImagePng">gdImagePng</a>
+by creating a custom data source and invoking gdImagePngFromSink.
 <pre>
 static int stdioSink(void *context, char *buffer, int len)
 {
 	return fwrite(buffer, 1, len, (FILE *) context);
 }
 
-void gdImageGif(gdImagePtr im, FILE *out)
+void gdImagePng(gdImagePtr im, FILE *out)
 {
 	gdSink mySink;
 	mySink.context = (void *) out;
 	mySink.sink = stdioSink;
-	gdImageGifToSink(im, &mySink);
+	gdImagePngToSink(im, &mySink);
 }
 </pre>
 <DT><A NAME="gdImageGd">
 be open for writing. Under MSDOS and all versions of Windows, it is
 important to use "wb" as
 opposed to simply "w" as the mode when opening the file, and under
-Unix there is no penalty for doing so. gdImageGif does <em>not</em>
+Unix there is no penalty for doing so. gdImagePng does <em>not</em>
 close the file; your code must do so.
 <P>
 The gd image format is intended for fast reads and writes of
 first image, any colors missing from the first image
 will be allocated. If not enough colors can be allocated,
 the closest colors already available will be used. This
-allows arbitrary GIFs to be used as brush images. It also
+allows arbitrary PNGs to be used as brush images. It also
 means, however, that you should not set a brush unless you
 will actually use it; if you set a rapid succession of
 different brush images, you can quickly fill your color map,
 FILE *in;
 int black;
 im = <A HREF="#gdImageCreate">gdImageCreate</A>(100, 100);
-/* Open the brush GIF. For best results, portions of the
+/* Open the brush PNG. For best results, portions of the
 	brush that should be transparent (ie, not part of the
 	brush shape) should have the transparent color index. */
-in = fopen("star.gif", "rb");
-brush = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("star.png", "rb");
+brush = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 /* Background color (first allocated) */
 black = <A HREF="#gdImageColorAllocate">gdImageColorAllocate</A>(im, 0, 0, 0);	
 gdImageSetBrush(im, brush);
 first image, any colors missing from the first image
 will be allocated. If not enough colors can be allocated,
 the closest colors already available will be used. This
-allows arbitrary GIFs to be used as tile images. It also
+allows arbitrary PNGs to be used as tile images. It also
 means, however, that you should not set a tile unless you
 will actually use it; if you set a rapid succession of
 different tile images, you can quickly fill your color map,
 FILE *in;
 int black;
 im = <A HREF="#gdImageCreate">gdImageCreate</A>(100, 100);
-/* Open the tile GIF. For best results, portions of the
+/* Open the tile PNG. For best results, portions of the
 	tile that should be transparent (ie, allowing the
 	background to shine through) should have the transparent
 	color index. */
-in = fopen("star.gif", "rb");
-tile = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("star.png", "rb");
+tile = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 /* Background color (first allocated) */
 black = <A HREF="#gdImageColorAllocate">gdImageColorAllocate</A>(im, 0, 0, 0);	
 gdImageSetTile(im, tile);
 FILE *in;
 gdImagePtr im;
 int c;
-in = fopen("mygif.gif", "rb");
-im = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("mypng.png", "rb");
+im = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 c = gdImageGetPixel(im, gdImageSX(im) / 2, gdImageSY(im) / 2);
 printf("The value of the center pixel is %d; RGB values are %d,%d,%d\n",
 In the event that all <A HREF="#gdMaxColors">gdMaxColors</A> colors
 (256) have already been allocated, gdImageColorAllocate will
 return -1 to indicate failure. (This is not uncommon when
-working with existing GIF files that already use 256 colors.)
+working with existing PNG files that already use 256 colors.)
 Note that gdImageColorAllocate
 does not check for existing colors that match your request;
 see <A HREF="#gdImageColorExact">gdImageColorExact</A>
 a drawing color when an image already contains
 <A HREF="#gdMaxColors">gdMaxColors</A> (256) colors and
 no more can be allocated. (This is not uncommon when
-working with existing GIF files that already use many colors.)
+working with existing PNG files that already use many colors.)
 See <A HREF="#gdImageColorExact">gdImageColorExact</A>
 for a method of locating exact matches only.
 <PRE>
 <A HREF="#gdImagePtr">gdImagePtr</A> im;
 FILE *in;
 int red;
-/* Let's suppose that photo.gif is a scanned photograph with
+/* Let's suppose that photo.png is a scanned photograph with
 	many colors. */
-in = fopen("photo.gif", "rb");
-im = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("photo.png", "rb");
+im = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 /* Try to allocate red directly */
 red = <A HREF="#gdImageColorAllocate">gdImageColorAllocate</A>(im, 255, 0, 0);	
 ... inside a function ...
 <A HREF="#gdImagePtr">gdImagePtr</A> im;
 int red;
-in = fopen("photo.gif", "rb");
-im = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("photo.png", "rb");
+im = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 /* The image may already contain red; if it does, we'll save a slot
 	in the color table by using that color. */
 ... inside a function ...
 <A HREF="#gdImagePtr">gdImagePtr</A> im;
 int red, blue;
-in = fopen("photo.gif", "rb");
-im = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("photo.png", "rb");
+im = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 /* Look for red in the color table. */
 red = gdImageColorExact(im, 255, 0, 0);
 <A HREF="#gdImagePtr">gdImagePtr</A> im;
 int black;
 FILE *in, *out;
-in = fopen("photo.gif", "rb");
-im = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+in = fopen("photo.png", "rb");
+im = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 /* Look for black in the color table and make it transparent. */
 black = <A HREF="#gdImageColorExact">gdImageColorExact</A>(im, 0, 0, 0);
 	gdImageColorTransparent(im, black);
 }
 /* Save the newly-transparent image back to the file */
-out = fopen("photo.gif", "wb");
-<A HREF="#gdImageGif">gdImageGif</A>(im, out);
+out = fopen("photo.png", "wb");
+<A HREF="#gdImagePng">gdImagePng</A>(im, out);
 fclose(out);
 /* Destroy it */
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
 int x, y;
 FILE *in;
 FILE *out;
-/* Load a small gif to tile the larger one with */
-in = fopen("small.gif", "rb");
-im_in = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+/* Load a small png to tile the larger one with */
+in = fopen("small.png", "rb");
+im_in = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 /* Make the output image four times as large on both axes */
 im_out = <A HREF="#gdImageCreate">gdImageCreate</A>(im_in->sx * 4, im_in->sy * 4);
 			im_in->sx, im_in->sy);
 	}
 }
-out = fopen("tiled.gif", "wb");
-<A HREF="#gdImageGif">gdImageGif</A>(im_out, out);
+out = fopen("tiled.png", "wb");
+<A HREF="#gdImagePng">gdImagePng</A>(im_out, out);
 fclose(out);
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im_in);
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im_out);
 int x, y;
 FILE *in;
 FILE *out;
-/* Load a small gif to expand in the larger one */
-in = fopen("small.gif", "rb");
-im_in = <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A>(in);
+/* Load a small png to expand in the larger one */
+in = fopen("small.png", "rb");
+im_in = <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A>(in);
 fclose(in);
 /* Make the output image four times as large on both axes */
 im_out = <A HREF="#gdImageCreate">gdImageCreate</A>(im_in->sx * 4, im_in->sy * 4);
 gdImageCopyResized(im_out, im_in, 0, 0, 0, 0,
 	im_out->sx, im_out->sy,
 	im_in->sx, im_in->sy);	
-out = fopen("large.gif", "wb");
-<A HREF="#gdImageGif">gdImageGif</A>(im_out, out);
+out = fopen("large.png", "wb");
+<A HREF="#gdImagePng">gdImagePng</A>(im_out, out);
 fclose(out);
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im_in);
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im_out);
 A nonzero value for the interlace argument turns on interlace;
 a zero value turns it off. Note that interlace has no effect
 on other functions, and has no meaning unless you save the
-image in GIF format; the gd and xbm formats do not support
+image in PNG format; the gd and xbm formats do not support
 interlace.
 <P>
-When a GIF is loaded with <A HREF="#gdImageCreateFromGif">gdImageCreateFromGif
-</A>, interlace will be set according to the setting in the GIF file.
+When a PNG is loaded with <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng
+</A>, interlace will be set according to the setting in the PNG file.
 <P>
-Note that many GIF viewers and web browsers do <em>not</em> support
-interlace. However, the interlaced GIF should still display; it
+Note that many PNG viewers and web browsers do <em>not</em> support
+interlace. However, the interlaced PNG should still display; it
 will simply appear all at once, just as other images do.
 <PRE>
 gdImagePtr im;
 /* Now turn on interlace */
 gdImageInterlace(im, 1);
 /* And open an output file */
-out = fopen("test.gif", "wb");
+out = fopen("test.png", "wb");
 /* And save the image */
-<A HREF="#gdImageGif">gdImageGif</A>(im, out);
+<A HREF="#gdImagePng">gdImagePng</A>(im, out);
 fclose(out);
 <A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
 </PRE>
 to draw broken lines with a series of distinct copies of an image.
 <DT><A NAME="gdMaxColors"><code>gdMaxColors</code><strong>(CONSTANT)</strong>
 <DD>
-The constant 256. This is the maximum number of colors in a GIF file
-according to the GIF standard, and is also the maximum number of
+The constant 256. This is the maximum number of colors in a PNG file
+according to the PNG standard, and is also the maximum number of
 colors in a gd image.
 <DT><A NAME="gdStyled">gdStyled</A> <strong>(CONSTANT)</strong>
 <DD>
 </DL>
 
 <A NAME="gdformat"><H3>About the additional .gd image file format</H3></A>
-In addition to reading and writing the GIF format and reading the
+In addition to reading and writing the PNG format and reading the
 X Bitmap format, gd has the capability to read and write its
 own ".gd" format. This format is <em>not</em> intended for
 general purpose use and should never be used to distribute
 images. It is not a compressed format. Its purpose is solely to
 allow very fast loading of images your program needs often in
 order to build other images for output. If you are experiencing
-performance problems when loading large, fixed GIF images your
+performance problems when loading large, fixed PNG images your
 program needs to produce its output images, you may wish
 to examine the functions <A HREF="#gdImageCreateFromGd">
 gdImageCreateFromGd</A> and <A HREF="#gdImageGd">gdImageGd</A>,
 which read and write .gd format images.
 
 <P>
-The program "giftogd.c" is provided as a simple way of converting
-.gif files to .gd format. I emphasize again that you will not
+The program "pngtogd.c" is provided as a simple way of converting
+.png files to .gd format. I emphasize again that you will not
 need to use this format unless you have a need for high-speed loading
 of a few frequently-used images in your program.
 
 <A NAME="gd2format"><H3>About the .gd2 image file format</H3></A>
-In addition to reading and writing the GIF format and reading the
+In addition to reading and writing the PNG format and reading the
 X Bitmap format, gd has the capability to read and write its
 own ".gd2" format. This format is <em>not</em> intended for
 general purpose use and should never be used to distribute
 to large image files. Its purpose is solely to
 allow very fast loading of <strong>parts</strong> of images
 If you are experiencing
-performance problems when loading large, fixed GIF images your
+performance problems when loading large, fixed PNG images your
 program needs to produce its output images, you may wish
 to examine the functions <A HREF="#gdImageCreateFromGd2">
 gdImageCreateFromGd2</A>, <A HREF="#gdImageCreateFromGd2Part">
 which read and write .gd2 format images.
 
 <P>
-The program "giftogd2.c" is provided as a simple way of converting
-.gif files to .gd2 format.
+The program "pngtogd2.c" is provided as a simple way of converting
+.png files to .gd2 format.
 
 <A NAME="gdioctx"><H3>About the gdIOCtx structure</H3></A>
-Version 1.5 of GD incorporates a new style of I/O based on an IOCtx
-structure (the most up-to-date version can be found in io.h):
+Version 1.5 of GD added a new style of I/O based on an IOCtx
+structure (the most up-to-date version can be found in gd_io.h):
 <PRE>
 typedef struct gdIOCtx {
         int     (*getC)(struct gdIOCtx*);
 <p>
 It is not necessary to implement all functions in an I/O context if you know
 that it will only be used in limited cirsumstances. At the time of writing
-(Version 1.5, June 1999), the known requirements are:
+(Version 1.6, June 1999), the known requirements are:
 <p>
 <Table>
 <TR><TD>All</TD><td width=20>&nbsp;</td><TD>Must have 'free',</td></tr>
 <A HREF="#gdImageCreateFromGd">gdImageCreateFromGd</A> |
 <A HREF="#gdImageCreateFromGd2">gdImageCreateFromGd2</A> |
 <A HREF="#gdImageCreateFromGd2Part">gdImageCreateFromGd2Part</A> |
-<A HREF="#gdImageCreateFromGif">gdImageCreateFromGif</A> |
-<A HREF="#gdImageCreateFromGifSource">gdImageCreateFromGifSource</A> |
+<A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A> |
+<A HREF="#gdImageCreateFromPngSource">gdImageCreateFromPngSource</A> |
 <A HREF="#gdImageCreateFromXbm">gdImageCreateFromXbm</A> |
 <A HREF="#gdImageDashedLine">gdImageDashedLine</A> |
 <A HREF="#gdImageDestroy">gdImageDestroy</A> |
 <A HREF="#gdImageGetInterlaced">gdImageGetInterlaced</A> |
 <A HREF="#gdImageGetPixel">gdImageGetPixel</A> |
 <A HREF="#gdImageGetTransparent">gdImageGetTransparent</A> |
-<A HREF="#gdImageGif">gdImageGif</A> |
-<A HREF="#gdImageGifToSink">gdImageGifToSink</A> |
 <A HREF="#gdImageGreen">gdImageGreen</A> |
 <A HREF="#gdImageInterlace">gdImageInterlace</A> |
 <A HREF="#gdImageLine">gdImageLine</A> |
 <A HREF="#gdImageFilledPolygon">gdImageFilledPolygon</A> |
 <A HREF="#gdImagePaletteCopy">gdImagePaletteCopy</A> |
+<A HREF="#gdImagePng">gdImagePng</A> |
+<A HREF="#gdImagePngToSink">gdImagePngToSink</A> |
 <A HREF="#gdImagePolygon">gdImagePolygon</A> |
 <A HREF="#gdImagePtr">gdImagePtr</A> |
 <A HREF="#gdImageRectangle">gdImageRectangle</A> |

File src/readme.txt

-   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT!
-   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT!
-   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT!
-   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT!
-   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT!
 
-                                    gd 1.5
+   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT.
+   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT.
+   SEE index.html FOR A MUCH MORE USEFUL HYPERTEXT VERSION OF THIS DOCUMENT.
+
+
+                                    gd 1.6
                                        
-A graphics library for fast GIF creation
+A graphics library for fast image creation
 
-Follow this link to the latest version of this document.
+Follow this link to the [1]latest version of this document.
 
   Table of Contents
   
-     * Credits and license terms
-     * What's new in version 1.5?
-     * What is gd?
-     * What if I want to use another programming language?
-     * What else do I need to use gd?
-     * How do I get gd?
-     * How do I build gd?
-     * gd basics: using gd in your program
-     * webgif: a useful example
-     * Function and type reference by category
-     * About the additional .gd image file format
-     * Please tell us you're using gd!
-     * If you have problems
-     * Alphabetical quick index
+     * [2]Credits and license terms
+     * [3]What's new in version 1.6?
+     * [4]What is gd?
+     * [5]What if I want to use another programming language?
+     * [6]What else do I need to use gd?
+     * [7]How do I get gd?
+     * [8]How do I build gd?
+     * [9]gd basics: using gd in your program
+     * [10]webgif: a useful example
+     * [11]Function and type reference by category
+     * [12]About the additional .gd image file format
+     * [13]Please tell us you're using gd!
+     * [14]If you have problems
+     * [15]Alphabetical quick index
        
-   Up to the Boutell.Com, Inc. Home Page
+   [16]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
+   this copyright notice, please contact [17]Thomas Boutell who will be
    pleased to correct them._
 
 COPYRIGHT STATEMENT FOLLOWS THIS LINE
 
-     Portions copyright 1994, 1995, 1996, 1997, 1998, by Cold Spring
-     Harbor Laboratory. Funded under Grant P41-RR02188 by the National
-     Institutes of Health.
-     
-     Portions copyright 1996, 1997, 1998, by Boutell.Com, Inc.
-     
-     GIF decompression code copyright 1990, 1991, 1993, by David Koblas
-     (koblas@netcom.com).
+     Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, by Cold
+     Spring Harbor Laboratory. Funded under Grant P41-RR02188 by the
+     National Institutes of Health.
      
-     Non-LZW-based GIF compression code copyright 1998, by Hutchison
-     Avenue Software Corporation (http://www.hasc.com/, info@hasc.com).
-     
-     LZW-based GIF compression code David Rowley. This code is compiled
-     only if the compiler macro LZW_LICENCED is defined when gd is
-     built. Obtaining a license for the Unisys LZW compression patent is
-     entirely between the user and Unisys. The authors of gd can provide
-     NO assistance in this matter.
+     Portions copyright 1996, 1997, 1998, 1999, by Boutell.Com, Inc.
      
      Portions relating to GD2 format copyright 1999 Philip Warner.
      
      notice appear in supporting documentation. This software is
      provided "as is" without express or implied warranty.
      
+     Although their code does not appear in gd 1.6, the authors wish to
+     thank David Koblas, David Rowley, and Hutchison Avenue Software
+     Corporation for their prior contributions.
+     
+     Permission to use, copy, modify, and distribute this software and
+     its documentation for any purpose and without fee is hereby
+     granted, provided that the above copyright notice appear in all
+     copies and that both that copyright notice and this permission
+     notice appear in supporting 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.
+     
 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 .GIF
+   other images, and flood fills, and write out the result as a .PNG
    file. This is particularly useful in World Wide Web applications,
-   where .GIF is the format used for inline images.
+   where .PNG is one 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
    
    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 1.3 incorporates most of the commonly
+   graphics package, but version 1.6 incorporates most of the commonly
    requested features for an 8-bit 2D package. Support for scalable
-   fonts, and truecolor images, JPEG and PNG is planned for version 2.0.
-   Version 1.3 was released to correct longstanding bugs and provide an
-   LZW-free GIF compression routine.
+   fonts, and truecolor images, JPEG and truecolor PNG is planned for
+   version 2.0.
    
   What if I want to use another programming language?
   
     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.
-   GD.pm is based on gd 1.1.1 but gd 1.2 should be compatible.
+   gd can also be used from Perl, courtesy of Lincoln Stein's [18]GD.pm
+   library, which uses gd as the basis for a set of Perl 5.x classes. Not
+   yet updated for gd 1.6. be compatible.
    
     Any Language
     
    text file from whatever scripting language you prefer to use, then
    invoke the interpreter.
    
-   These packages are based on gd 1.2 as of this writing but should be
-   compatible with gd 1.3x with minimal tweaking.
-     * tgd, by Bradley K. Sherman
-     * fly, by Martin Gleeson
+   These packages have not been updated to gd 1.6 as of this writing.
+     * [19]tgd, by Bradley K. Sherman
+     * [20]fly, by Martin Gleeson
        
+  What's new in version 1.6?
+  
+   Version 1.6 features the following changes:
+   
+   _Support for 8-bit palette PNG images has been added. Support for GIF
+   has been removed._ This step was taken to completely avoid the legal
+   controversy regarding the LZW compression algorithm used in GIF.
+   Unisys holds a patent which is relevant to LZW compression. PNG is a
+   superior image format in any case. Now that PNG is supported by both
+   Microsoft Internet Explorer and Netscape (in their recent releases),
+   we highly recommend that GD users upgrade in order to get
+   well-compressed images in a format which is legally unemcumbered.
+   
   What's new in version 1.5?
   
-   Version 1.5 features the following changes:
+   Version 1.5 featured the following changes:
    
    _New GD2 format_
           An improvement over the GD format, the GD2 format uses the zlib
           in a block of memory. This can be directly used by the GD perl
           module.
           
-   _LZW-based GIF compression code available for Unisys licensees_
-          Parties holding a legitimate license to use the patented LZW
-          compression algorithm can produce smaller GIFs if the compiler
-          macro LZW_LICENCED is defined when gd is built. Obtaining a
-          license for the Unisys LZW compression patent is entirely
-          between the user and Unisys. The authors of gd can provide NO
-          assistance in this matter.
-          
    _Added functions_
           gdImageCreateFromGd2Part - allows retrieval of part of an image
           (good for huge images, like maps),
           another, doing it's best to match the colors in the target
           image to the colors in the source palette.
           gdImageGd2, gdImageCreateFromGd2 - Support for new format
-          gdImageLzw - Optional support for LZW (for those who have a
-          licence). Disabled by default.
           gdImageCopyMerge - Merges two images (useful to highlight part
           of an image)
           gdImageCopyMergeGray - Similar to gdImageCopyMerge, but tries
           to preserve source image hue.
-          gdImageGifPtr, gdImageLzwPtr, gdImageGdPtr, gdImageGd2Ptr -
-          return memort blocks for each type of image.
-          gdImageCreateFromGifCtx, gdImageCreateFromGdCtx,
+          gdImagePngPtr, gdImageGdPtr, gdImageGd2Ptr - return memort
+          blocks for each type of image.
+          gdImageCreateFromPngCtx, gdImageCreateFromGdCtx,
           gdImageCreateFromGd2Ctx, gdImageCreateFromGd2PartCtx - Support
           for new I/O context.
           
    _NOTE:_ In fairness to Thomas Boutell, any bug/problems with any of
-   the above features should probably be reported to Philip Warner.
+   the above features should probably be reported to [21]Philip Warner.
    
   What's new in version 1.4?
   
           
    Support for alternate data sources
           Programmers who wish to load a GIF from something other than a
-          stdio FILE * stream can use the new gdImageCreateFromGifSource
-          function.
+          stdio FILE * stream can use the new
+          [22]gdImageCreateFromPngSource function.
           
    Support for alternate data destinations
           Programmers who wish to write a GIF to something other than a
-          stdio FILE * stream can use the new gdImageGifToSink function.
+          stdio FILE * stream can use the new [23]gdImagePngToSink
+          function.
           
    More tolerant when reading GIFs
           Version 1.4 does not crash when reading certain animated GIFs,
    Version 1.3 features the following changes:
    
    Non-LZW-based GIF compression code
-          Version 1.3 contains GIF compression code that uses simple Run
+          Version 1.3 contained GIF compression code that uses simple Run
           Length Encoding instead of LZW compression, while still
           retaining compatibility with normal LZW-based GIF decoders
           (your browser will still like your GIFs). _LZW compression is
-          patented by Unisys. This is why there have been no new versions
-          of gd for a long time. THANKS to Hutchison Avenue Software
-          Corporation for contributing this code. THE NEW CODE PRODUCES
-          LARGER GIFS AND IS NOT WELL SUITED TO PHOTOGRAPHIC IMAGES. THIS
-          IS A LEGAL ISSUE. IT IS NOT A QUESTION OF TECHNICAL SKILL.
-          PLEASE DON'T COMPLAIN ABOUT THE SIZE OF GIF OUTPUT. THANKS!_
+          patented by Unisys. We are currently reevaluating the approach
+          taken by gd 1.3. The current release of gd does not support
+          this approach. We recommend that you use the current release,
+          and generate PNG images._ Thanks to Hutchison Avenue Software
+          Corporation for contributing the RLE GIF code.
           
    8-bit fonts, and 8-bit font support
           This improves support for European languages. Thanks are due to
    have gcc should get it. gcc is free, ANSI compliant and a de facto
    industry standard. Ask your ISP why it is missing._
    
-   As of version 1.5, you also need the zlib compression library. It is
-   available for a variety of platforms from the zlib web site.
+   As of version 1.6, you also need the zlib compression library, and the
+   libpng library. zlib is available for a variety of platforms from
+   [24]the zlib web site. libpng is available for a variety of platforms
+   from [25]the PNG web site.
    
-   You will also want a GIF viewer, if you do not already have one for
+   You will also want a PNG viewer, if you do not already have one for
    your system, since you will need a good way to check the results of
-   your work. Any web browser will work, but you might be happier with a
-   package like Lview Pro for Windows or xv for X. There are GIF viewers
-   available for every graphics-capable computer out there, so consult
-   newsgroups relevant to your particular system.
+   your work. Netscape 4.04 and higher, and Microsoft Internet Explorer
+   4.0 or higher, both support PNG. For some purposes you might be
+   happier with a package like Lview Pro for Windows or xv for X. There
+   are PNG viewers available for every graphics-capable modern operating
+   system, so consult newsgroups relevant to your particular system.
    
   How do I get gd?
   
     By HTTP
     
-     * Gzipped Tar File (Unix)
-     * .ZIP File (Windows)
+     * [26]Gzipped Tar File (Unix)
+     * [27].ZIP File (Windows)
        
     By FTP
     
-     * Gzipped Tar File (Unix)
-     * .ZIP File (Windows)
+     * [28]Gzipped Tar File (Unix)
+     * [29].ZIP File (Windows)
        
   How do I build gd?
   
    (Windows), please consult with an experienced user of your system.
    Sorry, we cannot answer questions about basic Internet skills.
    
-   Unpacking the archive will produce a directory called "gd1.5".
+   Unpacking the archive will produce a directory called "gd1.6".
    
     For Unix
     
-   cd to the gd1.5 directory and examine the Makefile, which you will
+   cd to the gd1.6 directory and examine the Makefile, which you will
    probably need to change slightly depending on your operating system
    and your needs.
    
    You have now built a demonstration program which shows off the
    capabilities of gd. To see it in action, type "gddemo".
    
-   gddemo should execute without incident, creating the file demoout.gif.
-   (Note there is also a file named demoin.gif, which is provided in the
+   gddemo should execute without incident, creating the file demoout.png.
+   (Note there is also a file named demoin.png, which is provided in the
    package as part of the demonstration.)
    
-   Display demoout.gif in your GIF viewer. The image should be 128x128
+   Display demoout.png in your PNG viewer. The image should be 128x128
    pixels and should contain an image of the space shuttle with quite a
    lot of graphical elements drawn on top of it.
    
-   (If you are missing the demoin.gif file, the other items should appear
+   (If you are missing the demoin.png file, the other items should appear
    anyway.)
    
-   Look at demoin.gif to see the original space shuttle image which was
+   Look at demoin.png to see the original space shuttle image which was
    scaled and copied into the output image.
    
   gd basics: using gd in your program
   
-   gd lets you create GIF images on the fly. To use gd in your program,
+   gd lets you create PNG images on the fly. To use gd in your program,
    include the file gd.h, and link with the libgd.a library produced by
    "make libgd.a", under Unix. Under other operating systems you will add
    gd.c to your own project.
 /* Bring in gd library functions */
 #include "gd.h"
 
-/* Bring in standard I/O so we can output the GIF to a file */
+/* Bring in standard I/O so we can output the PNG to a file */
 #include <stdio.h>
 
 int main() {
         /* Declare the image */
-        gdImagePtr im;
+        [30]gdImagePtr im;
         /* Declare an output file */
         FILE *out;
         /* Declare color indexes */
         int white;
 
         /* Allocate the image: 64 pixels across by 64 pixels tall */
-        im = gdImageCreate(64, 64);
+        im = [31]gdImageCreate(64, 64);
 
         /* Allocate the color black (red, green and blue all minimum).
                 Since this is the first color in a new image, it will
                 be the background color. */
-        black = gdImageColorAllocate(im, 0, 0, 0);
+        black = [32]gdImageColorAllocate(im, 0, 0, 0);
 
         /* Allocate the color white (red, green and blue all maximum). */
-        white = gdImageColorAllocate(im, 255, 255, 255);
+        white = [33]gdImageColorAllocate(im, 255, 255, 255);
         
         /* Draw a line from the upper left to the lower right,
                 using white color index. */
-        gdImageLine(im, 0, 0, 63, 63, white);
+        [34]gdImageLine(im, 0, 0, 63, 63, white);
 
         /* Open a file for writing. "wb" means "write binary", important
                 under MSDOS, harmless under Unix. */
-        out = fopen("test.gif", "wb");
+        out = fopen("test.png", "wb");
 
         /* Output the image to the disk file. */
-        gdImageGif(im, out);
+        [35]gdImagePng(im, out);
 
         /* Close the file. */
         fclose(out);
 
         /* Destroy the image in memory. */
-        gdImageDestroy(im);
+        [36]gdImageDestroy(im);
 }
 
    When executed, this program creates an image, allocates two colors
    (the first color allocated becomes the background color), draws a
    diagonal line (note that 0, 0 is the upper left corner), writes the
-   image to a GIF file, and destroys the image.
+   image to a PNG file, and destroys the image.
    
    The above example program should give you an idea of how the package
    works. gd provides many additional functions, which are listed in the
    following reference chapters, complete with code snippets
-   demonstrating each. There is also an alphabetical index.
+   demonstrating each. There is also an [37]alphabetical index.
    
-  Webgif: a more powerful gd example
+  Webpng: a more powerful gd example
   
-   Webgif is a simple utility program to manipulate GIFs from the command
+   Webpng is a simple utility program to manipulate PNGs from the command
    line. It is written for Unix and similar command-line systems, but
-   should be easily adapted for other environments. Webgif allows you to
+   should be easily adapted for other environments. Webpng allows you to
    set transparency and interlacing and output interesting information
-   about the GIF in question.
+   about the PNG in question.
    
-   webgif.c is provided in the distribution. Unix users can simply type
-   "make webgif" to compile the program. Type "webgif" with no arguments
+   webpng.c is provided in the distribution. Unix users can simply type
+   "make webpng" to compile the program. Type "webpng" with no arguments
    to see the available options.
    
 Function and type reference
 
-     * Types
-     * Image creation, destruction, loading and saving
-     * Drawing, styling, brushing, tiling and filling functions
-     * Query functions (not color-related)
-     * Font and text-handling functions
-     * Color handling functions
-     * Copying and resizing functions
-     * Miscellaneous Functions
-     * Constants
+     * [38]Types
+     * [39]Image creation, destruction, loading and saving
+     * [40]Drawing, styling, brushing, tiling and filling functions
+     * [41]Query functions (not color-related)
+     * [42]Font and text-handling functions
+     * [43]Color handling functions
+     * [44]Copying and resizing functions
+     * [45]Miscellaneous Functions
+     * [46]Constants
        
   Types
   
    gdImage_(TYPE)_
-          The data structure in which gd stores images. gdImageCreate
+          The data structure in which gd stores images. [47]gdImageCreate
           returns a pointer to this type, and the other functions expect
           to receive a pointer to this type as their first argument. You
           may read the members sx (size on X axis), sy (size on Y axis),
 } gdImage;
 
    gdImagePtr _(TYPE)_
-          A pointer to an image structure. gdImageCreate returns this
+          A pointer to an image structure. [48]gdImageCreate returns this
           type, and the other functions expect it as the first argument.
           
    gdFont _(TYPE)_
 
    gdFontPtr _(TYPE)_
           A pointer to a font structure. Text-output functions expect
-          these as their second argument, following the gdImagePtr
+          these as their second argument, following the [49]gdImagePtr
           argument. Two such pointers are declared in the provided
           include files gdfonts.h and gdfontl.h.
           
    gdPoint _(TYPE)_
           Represents a point in the coordinate space of the image; used
-          by gdImagePolygon and gdImageFilledPolygon.
+          by [50]gdImagePolygon and [51]gdImageFilledPolygon.
           
 
 typedef struct {
 } gdPoint, *gdPointPtr;
 
    gdPointPtr _(TYPE)_
-          A pointer to a gdPoint structure; passed as an argument to
-          gdImagePolygon and gdImageFilledPolygon.
+          A pointer to a [52]gdPoint structure; passed as an argument to
+          [53]gdImagePolygon and [54]gdImageFilledPolygon.
           
    gdSource _(TYPE)_
 
         void *context;
 } gdSource, *gdSourcePtr;
 
-   Represents a source from which a GIF can be read. Programmers who do
-   not wish to read GIFs from a file can provide their own alternate
-   input mechanism, using the gdImageCreateFromGifSource function. See
-   the documentation of that function for an example of the proper use of
-   this type.
+   Represents a source from which a PNG can be read. Programmers who do
+   not wish to read PNGs from a file can provide their own alternate
+   input mechanism, using the [55]gdImageCreateFromPngSource function.
+   See the documentation of that function for an example of the proper
+   use of this type.
    
    gdSink _(TYPE)_
 
         void *context;
 } gdSink, *gdSinkPtr;
 
-   Represents a "sink" (destination) to which a GIF can be written.
-   Programmers who do not wish to write GIFs to a file can provide their
-   own alternate output mechanism, using the gdImageGifToSink function.
-   See the documentation of that function for an example of the proper
-   use of this type.
+   Represents a "sink" (destination) to which a PNG can be written.
+   Programmers who do not wish to write PNGs to a file can provide their
+   own alternate output mechanism, using the [56]gdImagePngToSink
+   function. See the documentation of that function for an example of the
+   proper use of this type.
    
   Image creation, destruction, loading and saving
   
    gdImageCreate(sx, sy) _(FUNCTION)_
           gdImageCreate is called to create images. Invoke gdImageCreate
           with the x and y dimensions of the desired image. gdImageCreate
-          returns a gdImagePtr to the new image, or NULL if unable to
+          returns a [57]gdImagePtr to the new image, or NULL if unable to
           allocate the image. The image must eventually be destroyed
-          using gdImageDestroy().
+          using [58]gdImageDestroy().
           
 
 ... inside a function ...
-gdImagePtr im;
+[59]gdImagePtr im;
 im = gdImageCreate(64, 64);
 /* ... Use the image ... */
-gdImageDestroy(im);
+[60]gdImageDestroy(im);
 
-   gdImageCreateFromGif(FILE *in) _(FUNCTION)_
-          gdImageCreateFromGifCtx(gdIOCtx *in) _(FUNCTION)_
+   gdImageCreateFromPng(FILE *in) _(FUNCTION)_
+          gdImageCreateFromPngCtx([61]gdIOCtx *in) _(FUNCTION)_
           
           
-          gdImageCreateFromGif is called to load images from GIF format
-          files. Invoke gdImageCreateFromGif with an already opened
+          gdImageCreateFromPng is called to load images from PNG format
+          files. Invoke gdImageCreateFromPng with an already opened
           pointer to a file containing the desired image.
-          gdImageCreateFromGif returns a gdImagePtr to the new image, or
-          NULL if unable to load the image (most often because the file
-          is corrupt or does not contain a GIF image).
-          gdImageCreateFromGif does _not_ close the file. You can inspect
+          gdImageCreateFromPng returns a [62]gdImagePtr to the new image,
+          or NULL if unable to load the image (most often because the
+          file is corrupt or does not contain a PNG image).
+          gdImageCreateFromPng does _not_ close the file. You can inspect
           the sx and sy members of the image to determine its size. The
-          image must eventually be destroyed using gdImageDestroy().
+          image must eventually be destroyed using [63]gdImageDestroy().
           
 
-gdImagePtr im;
+[64]gdImagePtr im;
 ... inside a function ...
 FILE *in;
-in = fopen("mygif.gif", "rb");
-im = gdImageCreateFromGif(in);
+in = fopen("mypng.png", "rb");
+im = gdImageCreateFromPng(in);
 fclose(in);
 /* ... Use the image ... */
-gdImageDestroy(im);
+[65]gdImageDestroy(im);
 
-   gdImageCreateFromGifSource(gdSourcePtr in) _(FUNCTION)_
-          gdImageCreateFromGifSource is called to load a GIF from a data
+   gdImageCreateFromPngSource(gdSourcePtr in) _(FUNCTION)_
+          gdImageCreateFromPngSource is called to load a PNG from a data
           source other than a file. Usage is very similar to the
-          gdImageCreateFromGif function, except that the programmer
+          [66]gdImageCreateFromPng function, except that the programmer
           provides a custom data source.
           
           The programmer must write an input function which accepts a
           requested, unless the end of the file has been reached, in
           which case the function should return zero, or an error has
           occurred, in which case the function should return -1. The
-          programmer then creates a gdSource structure and sets the
+          programmer then creates a [67]gdSource structure and sets the
           source pointer to the input function and the context pointer to
           any value which is useful to the programmer.
           
-          The example below implements gdImageCreateFromGif by creating a
-          custom data source and invoking gdImageCreateFromGifSource.
+          The example below implements [68]gdImageCreateFromPng by
+          creating a custom data source and invoking
+          gdImageCreateFromPngSource.
           
 
 static int freadWrapper(void *context, char *buf, int len);
 
-gdImagePtr gdImageCreateFromGif(FILE *in)
+gdImagePtr gdImageCreateFromPng(FILE *in)
 {
         gdSource s;
         s.source = freadWrapper;
         s.context = in;
-        return gdImageCreateFromGifSource(&s);
+        return gdImageCreateFromPngSource(&s);
 }
 
 static int freadWrapper(void *context, char *buf, int len)
 }
 
    gdImageCreateFromGd(FILE *in) _(FUNCTION)_
-          gdImageCreateFromGdCtx(gdIOCtx *in) _(FUNCTION)_
+          gdImageCreateFromGdCtx([69]gdIOCtx *in) _(FUNCTION)_
           
           
           gdImageCreateFromGd is called to load images from gd format
           files. Invoke gdImageCreateFromGd with an already opened
-          pointer to a file containing the desired image in the gd file
-          format, which is specific to gd and intended for very fast
+          pointer to a file containing the desired image in the [70]gd
+          file format, which is specific to gd and intended for very fast
           loading. (It is _not_ intended for compression; for
-          compression, use GIF.) gdImageCreateFromGd returns a gdImagePtr
-          to the new image, or NULL if unable to load the image (most
-          often because the file is corrupt or does not contain a gd
-          format image). gdImageCreateFromGd does _not_ close the file.
-          You can inspect the sx and sy members of the image to determine
-          its size. The image must eventually be destroyed using
-          gdImageDestroy().
+          compression, use PNG.) gdImageCreateFromGd returns a
+          [71]gdImagePtr to the new image, or NULL if unable to load the
+          image (most often because the file is corrupt or does not
+          contain a gd format image). gdImageCreateFromGd does _not_
+          close the file. You can inspect the sx and sy members of the
+          image to determine its size. The image must eventually be
+          destroyed using [72]gdImageDestroy().
           
 
 ... inside a function ...
-gdImagePtr im;
+[73]gdImagePtr im;
 FILE *in;
 in = fopen("mygd.gd", "rb");
 im = gdImageCreateFromGd(in);
 fclose(in);
 /* ... Use the image ... */
-gdImageDestroy(im);
+[74]gdImageDestroy(im);
 
    gdImageCreateFromGd2(FILE *in) _(FUNCTION)_
-          gdImageCreateFromGd2Ctx(gdIOCtx *in) _(FUNCTION)_
+          gdImageCreateFromGd2Ctx([75]gdIOCtx *in) _(FUNCTION)_
           
           
           gdImageCreateFromGd2 is called to load images from gd2 format
           files. Invoke gdImageCreateFromGd2 with an already opened
-          pointer to a file containing the desired image in the gd2 file
-          format, which is specific to gd2 and intended for fast loading
-          of parts of large images. (It is a compressed format, but
-          generally not as good a LZW compression). gdImageCreateFromGd
-          returns a gdImagePtr to the new image, or NULL if unable to
-          load the image (most often because the file is corrupt or does
-          not contain a gd format image). gdImageCreateFromGd2 does _not_
-          close the file. You can inspect the sx and sy members of the
-          image to determine its size. The image must eventually be
-          destroyed using gdImageDestroy().
+          pointer to a file containing the desired image in the [76]gd2
+          file format, which is specific to gd2 and intended for fast
+          loading of parts of large images. (It is a compressed format,
+          but generally not as good a LZW compression).
+          gdImageCreateFromGd returns a [77]gdImagePtr to the new image,
+          or NULL if unable to load the image (most often because the
+          file is corrupt or does not contain a gd format image).
+          gdImageCreateFromGd2 does _not_ close the file. You can inspect
+          the sx and sy members of the image to determine its size. The
+          image must eventually be destroyed using [78]gdImageDestroy().
           
 
 ... inside a function ...
-gdImagePtr im;
+[79]gdImagePtr im;
 FILE *in;
 in = fopen("mygd.gd2", "rb");
 im = gdImageCreateFromGd2(in);
 fclose(in);
 /* ... Use the image ... */
-gdImageDestroy(im);
+[80]gdImageDestroy(im);
 
    gdImageCreateFromGd2Part(FILE *in, int srcX, int srcY, int w, int h)
           _(FUNCTION)_
-          gdImageCreateFromGd2PartCtx(gdIOCtx *in) _(FUNCTION)_
+          gdImageCreateFromGd2PartCtx([81]gdIOCtx *in) _(FUNCTION)_
           
           
           gdImageCreateFromGd2Part is called to load parts of images from
-          gd2 format files. Invoked in the same way as
-          gdImageCreateFromGd2, but with extra parameters indicating the
-          source (x, y) and width/height of the desired image.
-          gdImageCreateFromGd2Part returns a gdImagePtr to the new image,
-          or NULL if unable to load the image. The image must eventually
-          be destroyed using gdImageDestroy().
+          [82]gd2 format files. Invoked in the same way as
+          [83]gdImageCreateFromGd2, but with extra parameters indicating
+          the source (x, y) and width/height of the desired image.
+          gdImageCreateFromGd2Part returns a [84]gdImagePtr to the new
+          image, or NULL if unable to load the image. The image must
+          eventually be destroyed using [85]gdImageDestroy().
           
    gdImageCreateFromXbm(FILE *in) _(FUNCTION)_
           gdImageCreateFromXbm is called to load images from X bitmap
           format files. Invoke gdImageCreateFromXbm with an already
           opened pointer to a file containing the desired image.
-          gdImageCreateFromXbm returns a gdImagePtr to the new image, or
-          NULL if unable to load the image (most often because the file
-          is corrupt or does not contain an X bitmap format image).
+          gdImageCreateFromXbm returns a [86]gdImagePtr to the new image,
+          or NULL if unable to load the image (most often because the
+          file is corrupt or does not contain an X bitmap format image).
           gdImageCreateFromXbm does _not_ close the file. You can inspect
           the sx and sy members of the image to determine its size. The
-          image must eventually be destroyed using gdImageDestroy().
+          image must eventually be destroyed using [87]gdImageDestroy().
           
 
 ... inside a function ...
-gdImagePtr im;
+[88]gdImagePtr im;
 FILE *in;
 in = fopen("myxbm.xbm", "rb");
 im = gdImageCreateFromXbm(in);
 fclose(in);
 /* ... Use the image ... */
-gdImageDestroy(im);
+[89]gdImageDestroy(im);
 
    gdImageDestroy(gdImagePtr im) _(FUNCTION)_
           gdImageDestroy is used to free the memory associated with an
           image. It is important to invoke gdImageDestroy before exiting
-          your program or assigning a new image to a gdImagePtr variable.
+          your program or assigning a new image to a [90]gdImagePtr
+          variable.
           
 
 ... inside a function ...
-gdImagePtr im;
-im = gdImageCreate(10, 10);
+[91]gdImagePtr im;
+im = [92]gdImageCreate(10, 10);
 /* ... Use the image ... */
 /* Now destroy it */
-gdImageDestroy(im);
+[93]gdImageDestroy(im);
 
-   void gdImageGif(gdImagePtr im, FILE *out) _(FUNCTION)_
-          gdImageGif outputs the specified image to the specified file in
-          GIF format. The file must be open for writing. Under MSDOS and
+   void gdImagePng(gdImagePtr im, FILE *out) _(FUNCTION)_
+          gdImagePng outputs the specified image to the specified file in
+          PNG format. The file must be open for writing. Under MSDOS and
           all versions of Windows, it is important to use "wb" as opposed
           to simply "w" as the mode when opening the file, and under Unix
-          there is no penalty for doing so. gdImageGif does _not_ close
+          there is no penalty for doing so. gdImagePng does _not_ close
           the file; your code must do so.
           
 
 ... inside a function ...
-gdImagePtr im;
+[94]gdImagePtr im;
 int black, white;
 FILE *out;
 /* Create the image */
-im = gdImageCreate(100, 100);
+im = [95]gdImageCreate(100, 100);
 /* Allocate background */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [96]gdImageColorAllocate(im, 255, 255, 255);
 /* Allocate drawing color */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [97]gdImageColorAllocate(im, 0, 0, 0);
 /* Draw rectangle */
-gdImageRectangle(im, 0, 0, 99, 99, black);
+[98]gdImageRectangle(im, 0, 0, 99, 99, black);
 /* Open output file in binary mode */
-out = fopen("rect.gif", "wb");
-/* Write GIF */
-gdImageGif(im, out);
+out = fopen("rect.png", "wb");
+/* Write PNG */
+gdImagePng(im, out);
 /* Close file */
 fclose(out);
 /* Destroy image */
-gdImageDestroy(im);
+[99]gdImageDestroy(im);
 
-   void* gdImageGifPtr(gdImagePtr im, int *size) _(FUNCTION)_
-          Identical to gdImageGif except that it returns a pointer to a
-          memory area with the GIF data. This memory must be freed by the
+   void* gdImagePngPtr(gdImagePtr im, int *size) _(FUNCTION)_
+          Identical to gdImagePng except that it returns a pointer to a
+          memory area with the PNG data. This memory must be freed by the
           caller when it is no longer needed. The 'size' parameter
           received the total size of the block of memory.
           
-   gdImageGifToSink(gdImagePtr im, gdSinkPtr out) _(FUNCTION)_
-          gdImageGifToSink is called to write a GIF to a data "sink"
+   gdImagePngToSink(gdImagePtr im, gdSinkPtr out) _(FUNCTION)_
+          gdImagePngToSink is called to write a PNG to a data "sink"
           (destination) other than a file. Usage is very similar to the
-          gdImageGif function, except that the programmer provides a
+          [100]gdImagePng function, except that the programmer provides a
           custom data sink.
           
           The programmer must write an output function which accepts a
           as arguments. This function must write the number of bytes
           requested and return that number, unless an error has occurred,
           in which case the function should return -1. The programmer
-          then creates a gdSink structure and sets the sink pointer to
-          the output function and the context pointer to any value which
-          is useful to the programmer.
+          then creates a [101]gdSink structure and sets the sink pointer
+          to the output function and the context pointer to any value
+          which is useful to the programmer.
           
-          The example below implements gdImageGif by creating a custom
-          data source and invoking gdImageGifFromSink.
+          The example below implements [102]gdImagePng by creating a
+          custom data source and invoking gdImagePngFromSink.
           
 
 static int stdioSink(void *context, char *buffer, int len)
         return fwrite(buffer, 1, len, (FILE *) context);
 }
 
-void gdImageGif(gdImagePtr im, FILE *out)
+void gdImagePng(gdImagePtr im, FILE *out)
 {
         gdSink mySink;
         mySink.context = (void *) out;
         mySink.sink = stdioSink;
-        gdImageGifToSink(im, &mySink);
+        gdImagePngToSink(im, &mySink);
 }
 
    void gdImageGd(gdImagePtr im, FILE *out) _(FUNCTION)_
           gdImageGd outputs the specified image to the specified file in
-          the gd image format. The file must be open for writing. Under
-          MSDOS and all versions of Windows, it is important to use "wb"
-          as opposed to simply "w" as the mode when opening the file, and
-          under Unix there is no penalty for doing so. gdImageGif does
-          _not_ close the file; your code must do so.
+          the [103]gd image format. The file must be open for writing.
+          Under MSDOS and all versions of Windows, it is important to use
+          "wb" as opposed to simply "w" as the mode when opening the
+          file, and under Unix there is no penalty for doing so.
+          gdImagePng does _not_ close the file; your code must do so.
           
           The gd image format is intended for fast reads and writes of
           images your program will need frequently to build other images.
           
 
 ... inside a function ...
-gdImagePtr im;
+[104]gdImagePtr im;
 int black, white;
 FILE *out;
 /* Create the image */
-im = gdImageCreate(100, 100);
+im = [105]gdImageCreate(100, 100);
 /* Allocate background */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [106]gdImageColorAllocate(im, 255, 255, 255);
 /* Allocate drawing color */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [107]gdImageColorAllocate(im, 0, 0, 0);
 /* Draw rectangle */
-gdImageRectangle(im, 0, 0, 99, 99, black);
+[108]gdImageRectangle(im, 0, 0, 99, 99, black);
 /* Open output file in binary mode */
 out = fopen("rect.gd", "wb");
 /* Write gd format file */
 /* Close file */
 fclose(out);
 /* Destroy image */
-gdImageDestroy(im);
+[109]gdImageDestroy(im);
 
    void* gdImageGdPtr(gdImagePtr im, int *size) _(FUNCTION)_
           Identical to gdImageGd except that it returns a pointer to a
    void gdImageGd2(gdImagePtr im, FILE *out, int chunkSize, int fmt)
           _(FUNCTION)_
           gdImageGd2 outputs the specified image to the specified file in
-          the gd2 image format. The file must be open for writing. Under
-          MSDOS and all versions of Windows, it is important to use "wb"
-          as opposed to simply "w" as the mode when opening the file, and
-          under Unix there is no penalty for doing so. gdImageGd2 does
-          _not_ close the file; your code must do so.
+          the [110]gd2 image format. The file must be open for writing.
+          Under MSDOS and all versions of Windows, it is important to use
+          "wb" as opposed to simply "w" as the mode when opening the
+          file, and under Unix there is no penalty for doing so.
+          gdImageGd2 does _not_ close the file; your code must do so.
           
           The gd2 image format is intended for fast reads and writes of
           parts of images. It is a compressed format, and well suited to
           
 
 ... inside a function ...
-gdImagePtr im;
+[111]gdImagePtr im;
 int black, white;
 FILE *out;
 /* Create the image */
-im = gdImageCreate(100, 100);
+im = [112]gdImageCreate(100, 100);
 /* Allocate background */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [113]gdImageColorAllocate(im, 255, 255, 255);
 /* Allocate drawing color */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [114]gdImageColorAllocate(im, 0, 0, 0);
 /* Draw rectangle */
-gdImageRectangle(im, 0, 0, 99, 99, black);
+[115]gdImageRectangle(im, 0, 0, 99, 99, black);
 /* Open output file in binary mode */
 out = fopen("rect.gd", "wb");
 /* Write gd2 format file */
 /* Close file */
 fclose(out);
 /* Destroy image */
-gdImageDestroy(im);
+[116]gdImageDestroy(im);
 
    void* gdImageGd2Ptr(gdImagePtr im, int chunkSize, int fmt, int *size)
           _(FUNCTION)_
           _(FUNCTION)_
           gdImageSetPixel sets a pixel to a particular color index.
           Always use this function or one of the other drawing functions
-          to access pixels; do not access the pixels of the gdImage
+          to access pixels; do not access the pixels of the [117]gdImage
           structure directly.
           
 
 ... inside a function ...
-gdImagePtr im;
+[118]gdImagePtr im;
 int black;
 int white;
-im = gdImageCreate(100, 100);
+im = [119]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [120]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [121]gdImageColorAllocate(im, 255, 255, 255);
 /* Set a pixel near the center. */
 gdImageSetPixel(im, 50, 50, white);
 /* ... Do something with the image, such as saving it to a file... */
 /* Destroy it */
-gdImageDestroy(im);
+[122]gdImageDestroy(im);
 
    void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int
           color) _(FUNCTION)_
           gdImageLine is used to draw a line between two endpoints (x1,y1
           and x2, y2). The line is drawn using the color index specified.
           Note that the color index can be an actual color returned by
-          gdImageColorAllocate or one of gdStyled, gdBrushed or
-          gdStyledBrushed.
+          [123]gdImageColorAllocate or one of [124]gdStyled,
+          [125]gdBrushed or [126]gdStyledBrushed.
           
 
 ... inside a function ...
-gdImagePtr im;
+[127]gdImagePtr im;
 int black;
 int white;
-im = gdImageCreate(100, 100);
+im = [128]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [129]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [130]gdImageColorAllocate(im, 255, 255, 255);
 /* Draw a line from the upper left corner to the lower right corner. */
 gdImageLine(im, 0, 0, 99, 99, white);
 /* ... Do something with the image, such as saving it to a file... */
 /* Destroy it */
-gdImageDestroy(im);
+[131]gdImageDestroy(im);
 
    void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2,
           int color) _(FUNCTION)_
           gdImageDashedLine is provided _solely for backwards
           compatibility _with gd 1.0. New programs should draw dashed
-          lines using the normal gdImageLine function and the new
-          gdImageSetStyle function.
+          lines using the normal [132]gdImageLine function and the new
+          [133]gdImageSetStyle function.
           
           gdImageDashedLine is used to draw a dashed line between two
           endpoints (x1,y1 and x2, y2). The line is drawn using the color
           
 
 ... inside a function ...
-gdImagePtr im;
+[134]gdImagePtr im;
 int black;
 int white;
-im = gdImageCreate(100, 100);
+im = [135]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [136]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [137]gdImageColorAllocate(im, 255, 255, 255);
 /* Draw a dashed line from the upper left corner to the lower right corner. */
 gdImageDashedLine(im, 0, 0, 99, 99);
 /* ... Do something with the image, such as saving it to a file... */
 /* Destroy it */
-gdImageDestroy(im);
+[138]gdImageDestroy(im);
 
    void gdImagePolygon(gdImagePtr im, gdPointPtr points, int pointsTotal,
           int color) _(FUNCTION)_
           gdImagePolygon is used to draw a polygon with the verticies (at
           least 3) specified, using the color index specified. See also
-          gdImageFilledPolygon.
+          [139]gdImageFilledPolygon.
           
 
 ... inside a function ...
-gdImagePtr im;
+[140]gdImagePtr im;
 int black;
 int white;
 /* Points of polygon */
-gdPoint points[3];
-im = gdImageCreate(100, 100);
+[141]gdPoint points[3];
+im = [142]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [143]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [144]gdImageColorAllocate(im, 255, 255, 255);
 /* Draw a triangle. */
 points[0].x = 50;
 points[0].y = 0;
 gdImagePolygon(im, points, 3, white);
 /* ... Do something with the image, such as saving it to a file... */
 /* Destroy it */
-gdImageDestroy(im);
+[145]gdImageDestroy(im);
 
    void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2,
           int color) _(FUNCTION)_
           
 
 ... inside a function ...
-gdImagePtr im;
+[146]gdImagePtr im;
 int black;
 int white;
-im = gdImageCreate(100, 100);
+im = [147]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [148]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [149]gdImageColorAllocate(im, 255, 255, 255);
 /* Draw a rectangle occupying the central area. */
 gdImageRectangle(im, 25, 25, 74, 74, white);
 /* ... Do something with the image, such as saving it to a file... */
 /* Destroy it */
-gdImageDestroy(im);
+[150]gdImageDestroy(im);
 
    void gdImageFilledPolygon(gdImagePtr im, gdPointPtr points, int
           pointsTotal, int color) _(FUNCTION)_
           gdImageFilledPolygon is used to fill a polygon with the
           verticies (at least 3) specified, using the color index
-          specified. See also gdImagePolygon.
+          specified. See also [151]gdImagePolygon.
           
 
 ... inside a function ...
-gdImagePtr im;
+[152]gdImagePtr im;
 int black;
 int white;
 int red;
 /* Points of polygon */
-gdPoint points[3];
-im = gdImageCreate(100, 100);
+[153]gdPoint points[3];
+im = [154]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [155]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = gdImageColorAllocate(im, 255, 255, 255);
+white = [156]gdImageColorAllocate(im, 255, 255, 255);
 /* Allocate the color red. */
-red = gdImageColorAllocate(im, 255, 0, 0);
+red = [157]gdImageColorAllocate(im, 255, 0, 0);
 /* Draw a triangle. */
 points[0].x = 50;
 points[0].y = 0;
 /* Paint it in white */
 gdImageFilledPolygon(im, points, 3, white);
 /* Outline it in red; must be done second */
-gdImagePolygon(im, points, 3, red);
+[158]gdImagePolygon(im, points, 3, red);
 /* ... Do something with the image, such as saving it to a file... */
 /* Destroy it */
-gdImageDestroy(im);
+[159]gdImageDestroy(im);
 
    void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int
           y2, int color) _(FUNCTION)_
           
 
 ... inside a function ...
-gdImagePtr im;
+[160]gdImagePtr im;
 int black;
 int white;
-im = gdImageCreate(100, 100);
+im = [161]gdImageCreate(100, 100);
 /* Background color (first allocated) */
-black = gdImageColorAllocate(im, 0, 0, 0);
+black = [162]gdImageColorAllocate(im, 0, 0, 0);
 /* Allocate the color white (red, green and blue all maximum). */
-white = int gdImageColorAllocate(im, 255, 255, 255);
+white = [163]int gdImageColorAllocate(im, 255, 255, 255);