by ivoras · 3y ago · 0 comments
It seems like operations with the format would be a bit faster if the pre-compression data would just be a framebuffer dump, instead of prefixing each row with a 1-byte "filter ID", possibly breaking data alignment.
So it is probably mandatory because only a tiny minority of images wouldn't use a filter. So it is better to just require it to avoid one more condition in the decoder.
Filtering as a separate preprocessing step allowed PNG to use off-the-shelf zlib for compression without needing to modify it.