README
1 Zopfli Compression Algorithm is a compression library programmed in C to perform
2 very good, but slow, deflate or zlib compression.
3
4 The basic function to compress data is ZopfliCompress in zopfli.h. Use the
5 ZopfliOptions object to set parameters that affect the speed and compression.
6 Use the ZopfliInitOptions function to place the default values in the
7 ZopfliOptions first.
8
9 ZopfliCompress supports deflate, gzip and zlib output format with a parameter.
10 To support only one individual format, you can instead use ZopfliDeflate in
11 deflate.h, ZopfliZlibCompress in zlib_container.h or ZopfliGzipCompress in
12 gzip_container.h.
13
14 ZopfliDeflate creates a valid deflate stream in memory, see:
15 http://www.ietf.org/rfc/rfc1951.txt
16 ZopfliZlibCompress creates a valid zlib stream in memory, see:
17 http://www.ietf.org/rfc/rfc1950.txt
18 ZopfliGzipCompress creates a valid gzip stream in memory, see:
19 http://www.ietf.org/rfc/rfc1952.txt
20
21 This library can only compress, not decompress. Existing zlib or deflate
22 libraries can decompress the data.
23
24 zopfli_bin.c is separate from the library and contains an example program to
25 create very well compressed gzip files. Currently the makefile builds this
26 program with the library statically linked in.
27
28 To build the binary, use "make". To build the library as a shared Linux library,
29 use "make libzopfli". The source code of Zopfli is under src/zopfli.
30
31 Zopfli Compression Algorithm was created by Lode Vandevenne and Jyrki
32 Alakuijala, based on an algorithm by Jyrki Alakuijala.
33
README.zopflipng
1 ZopfliPNG is a command line program to optimize the Portable Network Graphics
2 (PNG) images. This version has the following features:
3 - uses Zopfli compression for the Deflate compression,
4 - compares several strategies for choosing scanline filter codes,
5 - chooses a suitable color type to losslessly encode the image,
6 - removes all chunks that are unimportant for the typical web use (metadata,
7 text, etc...),
8 - optionally alters the hidden colors of fully transparent pixels for more
9 compression, and,
10 - optionally converts 16-bit color channels to 8-bit.
11
12 This is an alpha-release for testing while improvements, particularly to add
13 palette selection, are still being made. Feedback and bug reports are welcome.
14
15 To build ZopfliPNG, use "make zopflipng", or compile all the sources except
16 zopfli_bin.c.
17
18 The main compression algorithm in ZopfliPNG is ported from WebP lossless, but
19 naturally cannot give as much compression gain for PNGs as it does for a more
20 modern compression codec like WebP
21 https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification.
22
23 Compared to libpng -- an often used PNG encoder implementation -- ZopfliPNG uses
24 2-3 orders of magnitude more CPU time for compression. Initial testing using a
25 corpus of 1000 PNGs with translucency, randomly selected from the internet,
26 gives a compression improvement of 12% compared to convert -q 95, but only 0.5%
27 compared to pngout (from better of /f0 and /f5 runs).
28
29 By releasing this software we hope to make images on the web load faster without
30 a new image format, but the opportunities for optimization within PNG are
31 limited. When targeting Android, Chrome, Opera, and Yandex browsers, or by using
32 suitable plugins for other browsers, it is good to note that WebP lossless
33 images are still 26 % smaller than images recompressed with ZopfliPNG.
34
35 2013-05-07, Lode Vandevenne and Jyrki Alakuijala
36