I found creating custom cartridge labels to be an exceptionally infuriating process, so I built a python script that can transform any image file to a Pico 8 label. The tool works best with images made especially for Pico 8, with a size of 128x128 and their official color palette, but for shiz and giggles I made it work with any image.
Here's the GitHub repo: https://github.com/amirave/pico-label
If you don't want to go through the troubles of cloning the repo, just save the pico_label.py file inside of it (:
A demonstration of the tool:



Hi @amirave.
This has actually been an ongoing concern for years now. I posted one possible and simple solution HERE:



cool to see!
the interesting question is: which method did you choose to pick closest colour?



@mereok
quite a simple algorithm!
i store a list of all the RGBs of each color in the palette, and then pick the closest by euclidian distance (pretending that RGB is XYZ, just a standard distance function in 3D). if its still confusing, you can take a look at the source code i linked in the post(:(:



ah - you are missing secret colors!
(many other options exist for color matching, YCC color space appears to be a good candidate)



Note that labels can also use colours from the extended palette, using letters after f
(g
to v
). This will allow slightly better matches, especially if you also do some dithering! The OpenCV library that you use can do some dithering but I don’t know the specifics. There is also the Pillow library which is quite popular. The images below were made using some custom code.



@freds72 @samhocevar yall just blew my mind, I had no idea u could use the extended palette in the labels!!! 🤯



@ridgekuhn, you can use 24-bit if you like. You are not just limited to 32.
https://www.lexaloffle.com/bbs/?tid=36693
Be aware both the 32-color and 256^3 color do not appear correctly in SPLORE.



@ridgekuhn This can be achieved through external tools by manipulating colour bits, but be aware that’s it’s a one-way road; using non-standard colours will prevent converting the .p8.png back to .p8 or saving from PICO-8 itself.



Hi @ridgekuhn. Yep, as @samhocevar stated. It's really more of a parlor trick, not entirely useful. And if you try and save the cart back - the colors will be converted to Pico-8's own 16.
Same with the 32-color conversion method.
This makes sense though as all of Pico-8's memory is pretty tight and must fit within a small margin.



@dw817 My build pipeline is entirely external and one-way, so saving back isn't really an issue. I guess I'll probably stick to the standard labels but this is all good to know!
[Please log in to post a comment]