Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is really cool but I doubt this is now PICO8 works, since PNG lets you create arbitrary chunks of data that standard decoders will ignore:

> All ancillary chunks are optional, in the sense that encoders need not write them and decoders can ignore them.

http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html



You don't need to doubt, you can just check:

https://pico-8.fandom.com/wiki/P8PNGFileFormat

> The cart data is stored using a steganographic process. Each PICO-8 byte is stored as the two least significant bits of each of the four color channels, ordered ARGB


I stand corrected! I maintain it’s an odd choice given the availability of alternatives, but I suppose it’s all in good fun.


> I maintain it’s an odd choice given the availability of alternatives

The problem is that the "alternatives" are not reliable: image hosting sites commonly will optimise files by removing ancillary and unknown chunks, losing the data. However as long as they don't rewrite the image data itself (e.g. by resizing the PNG or putting it through a quantizer) the steganography method will ensure the data propagates correctly.


They could have created their own chunk type and set the safe-to-copy but to 1, permitting apps to round-trip the chunk without knowing exactly what was in it. From the spec:

> If a chunk's safe-to-copy bit is 1, the chunk may be copied to a modified PNG file whether or not the software recognizes the chunk type, and regardless of the extent of the file modifications.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: