I'm trying to understand compression in PNG - but I seem to find a lot of contradictory information online ... I would like to understand
Is the zlib implementation different from other deflate implementations?? Perhaps that is where all my confusion comes from?
Thank you for any help!! I need this for my new job
LuCu
PNG compression is in the zlib format. The zlib format uses deflate. The code used is commonly the zlib library.
The algorithm used for compression is not specified by the format. The zlib library deflate algorithm uses hash chains to search for matching strings in a sliding window. zlib's deflate takes several parameters for compression tuning -- see deflateInit2()
.
The deflate format specifies the compression of the Huffman codes at the front of dynamic blocks. The literal/length and distance code code lengths are run-length and Huffman coded themselves.
There are other implementations of deflate compressors in the LZMA SDK and Google's zopfli, where both of those use more intensive approaches that take more time for small gains in compression.