STRUKTURA: header: b'\x89PNG\r\n\x1a\n' chunks: { 'length': b'\x00\x00\x00\r', 'type': b'IHDR', 'data': b'\x00\x00\x00\x03\x00\x00\x00\x03\x08\x02\x00\x00\x00', 'CRC': b'\xd9J"\xe8', }, { 'length': b'\x00\x00\x00\x1c', 'type': b'IDAT', 'data': b'x\x9c%\xc3\xb1\r\x00\x00\x0c\xc3 >\xcf\xe9\xeeP$\x84_m\x83\x92\xd4\x01\xb4\xd2\rr', 'CRC': b'\xa6|\xffu', }, { 'length': b'\x00\x00\x00\x00', 'type': b'IEND', 'data': b'', 'CRC': b'\xaeB`\x82', } IHDR (obrázky s jinou konečnou pěticí než právě 82000 nebudeme zpracovávat): { 'width': 3, 'height': 3, 'bit depth': 8, 'colour type': 2, 'compression method': 0, 'filter method': 0, 'interlace method': 0, } IDAT: b'x\x9c%\xc3\xb1\r\x00\x00\x0c\xc3 >\xcf\xe9\xeeP$\x84_m\x83\x92\xd4\x01\xb4\xd2\rr' IDAT – rozkomprimovaný: b'\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\xff\xff\xff\x7f\x7f\x7f\x00\x00\x00\x00\xff\xff\x00\xff\x00\xff\x00\xff\xff' IDAT – zafiltrované scanlines ve tvaru "(filtr, [(RGB-hodnoty jednotlivých pixelů), ])": [ (0, [(255, 0, 0), (0, 255, 0), (0, 0, 255)]), (0, [(255, 255, 255), (127, 127, 127), (0, 0, 0)]), (0, [(255, 255, 0), (255, 0, 255), (0, 255, 255)]) ] IDAT – odfiltrované pixely (tady je to jednoduché, když je filtr 0 ^_^): [ [(255, 0, 0), (0, 255, 0), (0, 0, 255)], [(255, 255, 255), (127, 127, 127), (0, 0, 0)], [(255, 255, 0), (255, 0, 255), (0, 255, 255)] ]