3 ms·
Fantastic idea. On the image format part, PPM is indeed a great way to get off the ground. If you really want something more portable like PNG then it happens
by gorgoiler 6y ago
Fantastic idea. On the image format part, PPM is indeed a great way to get off the ground.
If you really want something more portable like PNG then it happens to be quite a fun library to implement. I encourage you to write your own. It’s basically:
- some magic number bytes
- a static header to announce the image is 8bit RGB zlib-compressed unfiltered non-interlaced
- a final set of magic bytes to say “here’s the actual image”
- zlib compressed rows of RGB bytes, with a 0 at the start of each row
So really just a fancy image.ppm.gz. What’s cool is that with 10 more lines of code you can implement animated PNG.