3 ms·
Good page. If I can I would also add a filtered image (or a set of them, if interlaced) to illustrate how PNG filters work. > The main reason to have multiple
by lifthrasiir 5y ago
Good page. If I can I would also add a filtered image (or a set of them, if interlaced) to illustrate how PNG filters work.
> The main reason to have multiple IDATs is if the encoder software wants to keep memory usage low and not need to buffer the entire IDAT, which is required just to know the final length of the chunk before starting to write the chunk.
It should be noted that this is only true for streaming applications where they have no chance to fix the length field already written.
> For example, outputting every DEFLATE symbol, every pixel value, or even every palette value, would be very verbose and probably not helpful.
I have some idea for the visualization, but one possibility is to show a list of DEFLATE blocks. zlib tries to break blocks when applicable as a sort of adaptive compression so it might be interesting to see overall changes in the image triggering new blocks. I've written a function to list blocks and their overheads (to encode Huffman trees), which is now a part of the Roadroller packer [1].
[1] https://github.com/lifthrasiir/roadroller/blob/main/deflate.js https://github.com/lifthrasiir/roadroller/blob/main/deflate....