Free time fun hobby project - let's write a PNG parser.
Everybody is blaming about reinventing the wheel... but there are so many types of wheels!
How can you learn it if you don't write it first? ;) I am kind of guy that is learning through exploring.
- Reads RGBA8888 images only at the moment - yay!!!
- Single C file - just
png.c
with everything in - No dependencies and extremely fast to compile!
- No interlace support at the moment
- Only dynamic huffman table support at the moment (easy to add fixed one)
- No uncompressed deflate blocks support at the moment (easy to add)
- No SIMD used at the moment (but it really wants to!)
- No multithreading support at the moment (but should it have?)
- No gamma support at the moment (but easy to add especially with SIMD!)
- No pallette support at the moment (does anybody care about that anymore?)
- Very simple huffman tree traversal implemented - can be optimized!
- Windows x64 only (adding more platforms is easy)
- Test application for viewing PNGs - written for Win32 OpenGL backend only at the moment
- All filters implemented - just need to optimize them
- Only IHDR, IDAT, IEND chunks supported at the moment
- MSVC only at the moment (adding more compilers is easy)
Surprise - just hit build.bat
and you are in!
Then just run png_view.exe test.png
and just look on it!
Surprise again - just hit 'test.bat' and let it test!
It will load reference test PNG file and compare it with uncompressed reference BMP file.