So reading PNG file specification indicates that before compression, the image is filtered. Currently only filtering method 0 is defined (2nd last byte in IHDR chunk). Method 0 has 5 sets of filtering functions:
0 = None
1 = Sub
2 = Up
3 = Average
4 = Paeth
When decoding such data, would only interlaced PNG images have filter types other than 0? Here's a same data after decompression:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
-----------------------------------------------
00 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f
7f 7f 7f 7f 7f 7f 10 0f 22 22 7f 7f 7f 7f 7f 7f
7f 00 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f
7f 7f 13 43 07 11 38 2e 2d 33 25 29 09 62 1b 7f
7f 7f ...
Note the 00
every 32 bytes that indicates a "None" filtering scheme. My question is, would this only appear for non-interlaced images? Does this mean interlaced images would have filtering functions 1, 2, 3, or 4? If so, during my decoding, I'd have to read in 33 bytes and take the first one and tests if it's 0x01, 0x02, 0x03, or 0x04 to see which filter function to use?