Deflate (source code)
= Deflate
{c}
{wiki}
<Deflate> is the <lossless source coding> method specified for <PNG> compression. It can describe repeated stretches of earlier data, going beyond the single-value repetitions of <run-length encoding>.<Portable Network Graphics (PNG) Specification (Third Edition) by Mark Adler and others>[W3C, PNG Specification, Third Edition, section 10.1, compression method 0]{ref}
The format combines <Deflate backreferences>, which describe repeated stretches, with <Deflate Huffman coding>, which represents the resulting instructions using <prefix codes>. <Deflate block framing> tells the decoder which codes apply and where decoding stops. RFC 1951, https://www.rfc-editor.org/rfc/rfc1951[DEFLATE Compressed Data Format Specification version 1.3] (May 1996), defines the format; different encoders can choose different instructions for the same <input>.<DEFLATE Compressed Data Format Specification version 1.3 by L. Peter Deutsch>[RFC 1951, heading and sections 2 and 4: format and encoder choices]{ref}
This separation is useful: discovering a repeated phrase and choosing short <codewords> solve different problems. A repeated phrase can contain many distinct <bytes>, while unequal <codeword lengths> can help even when no phrase repeats. Neither mechanism removes <Deflate compression overhead> or guarantees a saving on every <input>.
Back to article page