Zopfli

Last updated
Zopfli Archive
Original author(s) Lode Vandevenne and Jyrki Alakuijala
Developer(s) Google
Initial releaseFebruary 2013 (2013-02)
Stable release
1.0.3 [1]   OOjs UI icon edit-ltr-progressive.svg / 27 November 2019;4 years ago (27 November 2019)
Repository
Written in C
Type Data compression
License Apache License 2.0
Website github.com/google/zopfli   OOjs UI icon edit-ltr-progressive.svg

Zopfli is a data compression library that performs Deflate, gzip and zlib data encoding. [2] It achieves higher compression ratios than mainstream Deflate and zlib implementations at the cost of being slower. [3] Google first released Zopfli in February 2013 under the terms of Apache License 2.0. [4]

Contents

The name Zöpfli is the Swiss German diminutive of “Zopf”, an unsweetened type of Hefezopf. [5]

Operation

Zopfli can either generate a raw Deflate data stream or encapsulate it into gzip or zlib formats. Zopfli achieves higher data density through more exhaustive compression techniques. The method is based on iterating entropy modeling and a shortest path search algorithm to find a low bit cost path through the graph of all possible Deflate representations of the uncompressed data. [6] By default, Zopfli performs 15 iterations but could be configured to perform more or fewer. Under default settings, the output of Zopfli is typically 3–8% smaller than zlib's maximum compression, but takes around 80 times longer. [4] [3]

Because of its significantly slower compression speed, Zopfli is not suited for on-the-fly compression. It is typically used for one-time compression of static content. [7] [8] This is typically true for web content that is served with Deflate-based HTTP compression or web content in a Deflate-based file format such as PNG or WOFF font files. [9] Another use case is software updates or downloads with software package files that have a zip-based format such as Android application packages (APK) or Java Archives (JAR), especially over mobile connections. [10]

History

Zopfli is based on an algorithm from Jyrki Alakuijala. [11] The first reference implementation of Zopfli, by Jyrki Alakuijala and Lode Vandevenne, appeared in February 2013. Version 1.0.0 was released on April 25, 2013. [12] The reference implementation is a software library under the terms of Apache License 2.0, written in C. [2]

Since then, the open-source community made attempts to modify Zopfli for optimizing Portable Network Graphics (PNG) files because PNG uses a Deflate compression layer. The fruit of these modifications was ZopfliPNG, which was admitted into Google's Zopfli repository in May 2013. [13] The Zopfli algorithm has also been integrated into other PNG compression optimization tools like advpng (from the AdvanceCOMP utility suite) [14] and OxiPNG. [15]

See also

Related Research Articles

gzip GNU file compression/decompression tool

gzip is a file format and a software application used for file compression and decompression. The program was created by Jean-loup Gailly and Mark Adler as a free software replacement for the compress program used in early Unix systems, and intended for use by GNU. Version 0.1 was first publicly released on 31 October 1992, and version 1.0 followed in February 1993.

Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits statistical redundancy. By contrast, lossy compression permits reconstruction only of an approximation of the original data, though usually with greatly improved compression rates.

<span class="mw-page-title-main">PNG</span> Family of lossless-compression image file formats

Portable Network Graphics is a raster-graphics file format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF)—unofficially, the initials PNG stood for the recursive acronym "PNG's not GIF".

zlib DEFLATE codec library

zlib is a software library used for data compression as well as a data format. zlib was written by Jean-loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compression program. zlib is also a crucial component of many software platforms, including Linux, macOS, and iOS. It has also been used in gaming consoles such as the PlayStation 4, PlayStation 3, Wii U, Wii, Xbox One and Xbox 360.

In computing, Deflate is a lossless data compression file format that uses a combination of LZ77 and Huffman coding. It was designed by Phil Katz, for version 2 of his PKZIP archiving tool. Deflate was later specified in RFC 1951 (1996).

OpenEXR is a high-dynamic range, multi-channel raster file format, released as an open standard along with a set of software tools created by Industrial Light & Magic (ILM), under a free software license similar to the BSD license.

ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed. The ZIP file format permits a number of compression algorithms, though DEFLATE is the most common. This format was originally created in 1989 and was first implemented in PKWARE, Inc.'s PKZIP utility, as a replacement for the previous ARC compression format by Thom Henderson. The ZIP format was then quickly supported by many software utilities other than PKZIP. Microsoft has included built-in ZIP support in versions of Microsoft Windows since 1998 via the "Plus! 98" addon for Windows 98. Native support was added as of the year 2000 in Windows ME. Apple has included built-in ZIP support in Mac OS X 10.3 and later. Most free operating systems have built in support for ZIP in similar manners to Windows and macOS.

compress is a Unix shell compression program based on the LZW compression algorithm. Compared to gzip's fastest setting, compress is slightly slower at compression, slightly faster at decompression, and has a significantly lower compression ratio. 1.8 MiB of memory is used to compress the Hutter Prize data, slightly more than gzip's slowest setting.

7z is a compressed archive file format that supports several different data compression, encryption and pre-processing algorithms. The 7z format initially appeared as implemented by the 7-Zip archiver. The 7-Zip program is publicly available under the terms of the GNU Lesser General Public License. The LZMA SDK 4.62 was placed in the public domain in December 2008. The latest stable version of 7-Zip and LZMA SDK is version 23.01.

<span class="mw-page-title-main">HTTP compression</span> Capability that can be built into web servers and web clients

HTTP compression is a capability that can be built into web servers and web clients to improve transfer speed and bandwidth utilization.

<span class="mw-page-title-main">Mark Adler</span> American software engineer

Mark Adler is an American software engineer. He is best known for his work in the field of data compression as the author of the Adler-32 checksum function, and a co-author together with Jean-loup Gailly of the zlib compression library and gzip. He has contributed to Info-ZIP, and has participated in developing the Portable Network Graphics (PNG) image format. Adler was also the Spirit Cruise Mission Manager for the Mars Exploration Rover mission.

XZ Utils is a set of free software command-line lossless data compressors, including the programs lzma and xz, for Unix-like operating systems and, from version 5.0 onwards, Microsoft Windows. For compression/decompression the Lempel–Ziv–Markov chain algorithm (LZMA) is used. XZ Utils started as a Unix port of Igor Pavlov's LZMA-SDK that has been adapted to fit seamlessly into Unix environments and their usual structure and behavior.

mod_deflate is an optional module for the Apache HTTP Server, Apache v2.0 and later. It is based on Deflate lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding. This module provides the DEFLATE output filter that allows output from Apache HTTP server to be compressed before being sent to the client over the network. It also provides a filter for decompressing a gzip compressed response body.

LZ4 is a lossless data compression algorithm that is focused on compression and decompression speed. It belongs to the LZ77 family of byte-oriented compression schemes.

Brotli is a lossless data compression algorithm developed by Google. It uses a combination of the general-purpose LZ77 lossless compression algorithm, Huffman coding and 2nd-order context modelling. Brotli is primarily used by web servers and content delivery networks to compress HTTP content, making internet websites load faster. A successor to gzip, it is supported by all major web browsers and has become increasingly popular, as it provides better compression than gzip.

LZFSE is an open source lossless data compression algorithm created by Apple Inc. It was released with a simpler algorithm called LZVN.

Zstandard is a lossless data compression algorithm developed by Yann Collet at Facebook. Zstd is the corresponding reference implementation in C, released as open-source software on 31 August 2016.

<span class="mw-page-title-main">Guetzli</span> JPEG encoder

Guetzli is a freely licensed JPEG encoder that Jyrki Alakuijala, Robert Obryk, and Zoltán Szabadka have developed in Google's Zürich research branch. The encoder seeks to produce significantly smaller files than prior encoders at equivalent quality, albeit at very low speed. It is named after the Swiss German diminutive expression for biscuits, in line with the names of other compression technology from Google.

842, 8-4-2, or EFT is a data compression algorithm. It is a variation on Lempel–Ziv compression with a limited dictionary length. With typical data, 842 gives 80 to 90 percent of the compression of LZ77 with much faster throughput and less memory use. Hardware implementations also provide minimal use of energy and minimal chip area.

References

  1. "Release 1.0.3". 27 November 2019. Retrieved 28 November 2019.
  2. 1 2 "google/zopfli · GitHub". Github.com. Retrieved 2015-09-29.
  3. 1 2 "A Look At Zopfli, Google's Open Source Compression Algorithm | Lifehacker Australia". Lifehacker.com.au. 2013-03-03. Retrieved 2015-09-29.
  4. 1 2 "Compress data more densely with Zopfli - Google Developers Blog". Googledevelopers.blogspot.com. 2013-02-28. Retrieved 2013-05-01.
  5. Alexander Neumann (March 2013). "Zopfli: Neue Kompressionsbibliothek von Google | heise Developer" (in German). Heise.de . Retrieved 2015-09-29.
  6. "Zopfli: Google's new data compression algorithm". Digit. 2013-03-01. Retrieved 2015-09-29.
  7. Dean Hume (2015-06-01). "Improved Compression Ratios Using Zopfli" . Retrieved 2015-09-06.
  8. Sharwood, Simon (2013). "Google open sources very slow compression algorithm". The Register.
  9. Ilya Grigorik (2014-01-09). "Google Fonts recently switched to using new Zopfli compression algorithm". Google+. Retrieved 2015-06-06.
  10. Sanders, James. "Google's Zopfli Compression Algorithm: Extract higher performance from your compressed files". TechRepublic . Retrieved 2021-03-31.
  11. "zopfli/README at master · google/zopfli". GitHub.
  12. "Release Zopfli-1.0.0". Github.com. 2013-04-25. Retrieved 2015-09-06.
  13. "ZopfliPNG : Google/zopfli@337d27f". Github.com. Retrieved 2015-09-29.
  14. Andrea Mazzoleni. "Advance Projects". Advancemame.sourceforge.net. Retrieved 2015-09-29.
  15. Josh Holmer. "shssoichiro/oxipng - Github". GitHub . Retrieved 2019-08-05.