Hacker News new | ask | show | jobs
by ehsankia 2107 days ago
I don't know if I'm stupid, but those anyone have an example PICO-8 PNG? I can't find one in either of the two links you sent, nor on the internet. Am i missing something here?
1 comments

Click "Cart" on the bottom left of the BBS entries.

E.g. on https://www.lexaloffle.com/bbs/?tid=29967

Takes you to https://www.lexaloffle.com/bbs/cposts/4/44467.p8.png

Huh, so the PNG actually looks like a real cartridge? How are they able to do that? Is the data section hidden in a non-visible part of the file, or are they able to somehow encode it in there while still having it look visually like a cartridge?
https://pico-8.fandom.com/wiki/P8PNGFileFormat

The images are RGBA PNGs. So for each display pixel there's a byte for each color channel and the alpha channel. The two least significant bits in each byte are a quarter of a PICO-8 data byte. Those bits are read from a channel byte and concatenated in RGBA order to get a data byte.

Using the LSBs for each channel means the those swizzled bits won't contribute very much to that pixel's color value. At worst it would just look like noise in the image.

Also by putting the data inside the image data of a PNG it won't be stripped off by some optimizer or hosting service.