TkPNG - PNG Photo Image extension for Tcl/Tk

Copyright (c) 2006 Muonics, Inc.

See the file "license.terms" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.

This package implements support for loading and using PNG images with
Tcl/Tk.  Although other extensions such as Img also add support for PNG
images, I wanted something that was lightweight, did not depend on libpng,
and that would be suitable for inclusion in the Tk core.  Tk does not
currently support any image formats natively that take advantage of its
internal support for alpha blending, and alpha antialiasing and drop
shadows really go a long way toward beautifying Tk applications.

The package supports the full range of color types, channels and bit depths
from 1 bit black & white to 16 bit per channel full color with alpha (64
bit RGBA) and interlacing.  Ancillary "chunks" such as gamma, color
profile, and text fields are ignored, although they are checked at a
minimum for correct CRC.

Images can be read from file, from binary data, or from base64-encoded
data.  Images can be written to file or to binary data.

When writing PNG images, TkPNG currently does no line filtering and does
not make any attempts at optimizing color space, meaning no attempts are
made to yield the smallest possible file.  A future revision will probably
fix the filtering to Paeth, as recommended by the PNG specification, for
some improvement in common cases.  Where file size is important, it's best
to use one of the many available tools for optimizing PNG images for size,
rather than resorting to time-consuming brute-force analysis in TkPNG.

Also, writing interlaced images is not currently supported.  If you read an
interlaced image and then write it back out, it will become non-interlaced.

This extension is provided under the Tcl license (see the file
"license.terms" for details), though acknowledgements and/or donations are
of course accepted and appreciated. :)

Finally, special thanks to Willem van Schaik's suite for his suite of PNG
test images, which are available from:

http://www.schaik.com/pngsuite/pngsuite.html

-- Michael Kirkham
