I am trying to understand how PNG files work. I am stuck on how you decompress the IDAT data. I have searched the whole Internet, but I haven't found anything that I understand.
I have this HEX Code of an example PNG.
I have extracted the data of the IDAT chunk, here in hexadecimal: 08 1D 63 60 60 60 F8 0F 00 01 04 01 00 1E 73 9C 40
.
I don't understand how to decompress this. I got as far as the first byte, which is the compression mode/flag code, and the second byte, which is additonal flags, and the last four bytes is the check value. What do they mean and how you decompress now the data?
I think I will understand it with one or more examples. Here is an IDAT chunk from a different PNG file: 18 19 62 64 60 f8 fa 9f 01 08 00 00 00 00 ff ff 63 64 60 f8 fa 9f 81 e1 3f 03 00 29 31 04 ea
.
I would really appreciate it if someone could explain to me for those two examples how zlib decoding works.