PNG-Tech
Technical Issues Regarding the PNG File Format
This site contains a collection of comments, impressions, comparisons,
experiments and ideas regarding the
PNG (Portable Network Graphics)
file format, and related technologies:
ZLIB (Data Compression Format and Library),
and MNG (Multiple-Image Network
Graphics). It is focused on the compression algorithms used in PNG.
New!
OptiPNG-0.5.5 is now
available at SourceForge.
PNG uses ZLIB streams [RFC1950]
as compressed datastreams. The compression algorithm, called Deflate
[RFC1951], was designed by
Phil Katz and used initially in PKZIP.
Jean-loup Gailly and Mark Adler rewrote the code, avoiding any patented
algorithms. This code, freely available in source, can be found
here.
Additional technical details are provided
here.
A good explanation of the Deflate algorithm by Antaeus Feldspar
is available
here.
We use the term ZLIB (written with capital letters) when we refer to the
standard or to standard-compliant streams, and the term zlib (written
with small letters) when we refer to the reference implementation.
Any comments, suggestions and contributed
articles are welcome.
- ZLIB-related articles
-
Proposal for correcting the ZLIB
specification
In the current ZLIB specification, described in RFC1950, some boundary
conditions regarding the size of the sliding window are incomplete.
The proposal addresses this issue.
-
Bug fix for 256-byte sliding windows in
zlib-1.1.3
In the zlib implementations up to version 1.1.3, there is a problem with
256-byte sliding windows. This window size is disabled in zlib-1.1.4.
It is unknown when a complete fix will be available.
Upgrading to a newer zlib is strongly recommended, due to a
security
problem that exists in zlib prior to 1.1.4.
-
Proposal for a new zlib strategy: Z_RLE
Z_RLE is a fast strategy that has a high speed and a low memory overhead,
like Z_HUFFMAN_ONLY, but achieves a better compression ratio.
New!
The Z_RLE strategy is implemented in the zlib-1.2.x series.
-
TOO_FAR in zlib is not too far...
A parameter used in the zlib source code should be set to a higher value,
in order to achieve a slightly better compression.
- PNG-related articles
-
A guide to PNG optimization
PNG compression does not depend only on the image statistics, but it may vary
within large limits, depending on several compression parameters.
-
Brute-force vs. heuristic filtering
The filtering heuristics proposed in the PNG specification yield good results
in most of the cases. There are a few cases, however, when these heuristics are
less than optimal.
-
LZW-GIF can be sometimes better than Deflate
The Deflate compression used by PNG is superior to the LZW compression used by
GIF. There are very few isolated cases when LZW is marginally better, and this
article presents such examples.
-
8 bits per pixel in paletted images
This article shows an example in which the encoding of an image using as few
bits per pixel as possible, is suboptimal.
- MNG-related articles
- Links
-
Books
Although many books (mostly about computer imaging) mention PNG and MNG, only a
few explain how these formats actually work. If you are looking for such
details, you may find this list useful.
-
Related articles
Some others sites also contain material directly related to the purpose of
PNG-Tech.
-
Corpora
Uncompressed or PNG-compressed images that can be freely distributed, and can
be used in compression tests.
Copyright © 2000-2007
Appeared: 16 Jan 2000. Last updated: 28 Jan 2007.