Renchao Wu · byte-by-byte encoding · v0.1.0

PNG Row Filter Desk

Six PNG encodings. Exactly the same RGBA bytes.

Inspect None, Sub, Up, Average, Paeth and a row-score heuristic. See each byte's predictor, wrapped residual and reconstruction, then download actual PNGs. A smaller row score does not guarantee the smallest compressed file.

Source pixels

Exactly {width,height,rgba}. The array is row-major R,G,B,A with four integer bytes per pixel. Alpha is unpremultiplied; invisible RGB values are retained in the encoded bytes. Ctrl+Enter encodes.

Loading original examples…

Preparing six encodings…

What the heuristic can miss

The row-score rule makes local choices. DEFLATE compresses the complete sequence of filtered rows, including type bytes, so a fixed filter can produce a smaller PNG. All six results, ties and losing heuristic cases stay visible. The supplied examples were fixed before compression results were measured.

This original implementation follows W3C PNG filtering. It uses standard algorithms and the platform's actual CompressionStream API, with no learned model or new compression algorithm.