blob: 37f6fc3e70424038bd27deb06592f0242363f6cd [file] [log] [blame]
Lode Vandevenneb50b7ef2013-01-16 10:30:56 +01001Zopfli Compression Algorithm is a compression library programmed in C to perform
2very good, but slow, deflate or zlib compression.
3
Lode Vandevenne4975aa52013-04-25 16:00:01 +02004The basic function to compress data is ZopfliCompress in zopfli.h. Use the
5ZopfliOptions object to set parameters that affect the speed and compression.
6Use the ZopfliInitOptions function to place the default values in the
7ZopfliOptions first.
Lode Vandevenneb50b7ef2013-01-16 10:30:56 +01008
Lode Vandevenne4975aa52013-04-25 16:00:01 +02009ZopfliCompress supports deflate, gzip and zlib output format with a parameter.
10To support only one individual format, you can instead use ZopfliDeflate in
11deflate.h, ZopfliZlibCompress in zlib_container.h or ZopfliGzipCompress in
12gzip_container.h.
Lode Vandevenneb50b7ef2013-01-16 10:30:56 +010013
Lode Vandevenne4975aa52013-04-25 16:00:01 +020014ZopfliDeflate creates a valid deflate stream in memory, see:
Lode Vandevenned5eb5f52013-02-14 14:41:44 +010015http://www.ietf.org/rfc/rfc1951.txt
Lode Vandevenne4975aa52013-04-25 16:00:01 +020016ZopfliZlibCompress creates a valid zlib stream in memory, see:
Lode Vandevenned5eb5f52013-02-14 14:41:44 +010017http://www.ietf.org/rfc/rfc1950.txt
Lode Vandevenne4975aa52013-04-25 16:00:01 +020018ZopfliGzipCompress creates a valid gzip stream in memory, see:
Lode Vandevenned5eb5f52013-02-14 14:41:44 +010019http://www.ietf.org/rfc/rfc1952.txt
Lode Vandevenneb50b7ef2013-01-16 10:30:56 +010020
21This library can only compress, not decompress. Existing zlib or deflate
22libraries can decompress the data.
23
Lode Vandevenne4975aa52013-04-25 16:00:01 +020024zopfli_bin.c is separate from the library and contains an example program to
25create very well compressed gzip files. Currently the makefile builds this
26program with the library statically linked in.
27
Lode Vandevenne9bc747b2016-02-08 17:51:18 +010028The source code of Zopfli is under src/zopfli. Build instructions:
Lode Vandevennea8a723d2016-02-08 17:50:09 +010029
30To build zopfli, compile all .c source files under src/zopfli to a single binary
31with C, and link to the standard C math library, e.g.:
Lode Vandevenne975ac802016-04-25 13:27:46 +020032gcc src/zopfli/*.c -O2 -W -Wall -Wextra -Wno-unused-function -ansi -pedantic -lm -o zopfli
Lode Vandevennea8a723d2016-02-08 17:50:09 +010033
34A makefile is provided as well, but only for linux. Use "make" to build the
35binary, "make libzopfli" to build it as a shared library. For other platforms,
36please use the build instructions above instead.
37
Lode Vandevenneb50b7ef2013-01-16 10:30:56 +010038Zopfli Compression Algorithm was created by Lode Vandevenne and Jyrki
39Alakuijala, based on an algorithm by Jyrki Alakuijala.