Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deflate: uncompressing a PNG without zlib (or any other library)

Tags:

c

png

deflate

The other day, I thought that I would learn more about image compression. I looked into .png and its respective compression algorithm and I would like to be able to uncompress the file without any other library as a way for me to learn more about data compression. I am having a difficult time finding info on how to decompress a png without a third-party library and was hoping someone may be able to either point me in the right direction or briefly explain it.

like image 489
Chase Walden Avatar asked Oct 15 '25 04:10

Chase Walden


2 Answers

I'd start with reading about the DEFLATE compression for example on wikipedia or RFC 1951 as this is the base of the PNG compression (at least according to wikipedia). There is also a brief explaination of the filtering which preceeds the DEFLATE is available.

like image 138
junix Avatar answered Oct 17 '25 19:10

junix


If you want to decompress the deflate data, you'll need to be able to find it. So you should first learn about the structure of PNG files. Then see other answer.

like image 36
Mark Adler Avatar answered Oct 17 '25 19:10

Mark Adler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!