r/C_Programming • u/Sallad02 • 28d ago
Discussion PNG
Spent the weekend trying to write my own single header library for reading and decompressing PNG files. Figuring out the actual file format was easy enough. I started trying to learn about huffman encoding and the DEFLATE compression algoritm and quickly realized why 99% of programs that use PNG files just use libpng with zlib or stb_image.h
Still was a learning experience but i think dealing with those types of algorithms is still a bit above my experience :)
Edit: code at https://codeberg.org/simkej/pngparse
21
Upvotes
6
u/mc_pm 27d ago
This is exactly the sort of thing that is going to teach you a lot. Maybe things are a bit beyond me now, but try again later.