> This is due to the fact that the specification of the PNG has a sliding window of 32 kB for performance reasons.<p>It’s a bit of a shortcut: in reality PNG uses DEFLATE, and it’s DEFLATE which has a 32kB window.<p>And it’s not exactly performance reasons but memory budget, especially as deflate was designed for <i>streaming</i>, both when compressing and decompressing: when decompressing you need a buffer at least as large as the window, and when compressing you need that plus most likely an index of some sort (so you don’t have to look for matches linearly through the buffer).<p>This is more relevant with the context that Phil Katz created deflate in 1991, high-end desktops reached high single-digit megabytes of RAM but the low end might not even be there (Windows 3.0 required 1MB to run decently).<p>By comparison, if memory serves zstd uses a window of 8MB (or 16 depending on setting), though configurable anywhere from 1k to 512MB