Log In  

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:

P#126732 2023-03-07 20:40

Hi @amirave.

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

https://www.lexaloffle.com/bbs/?tid=35876

P#126739 2023-03-07 21:12

cool to see!

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

P#126747 2023-03-07 23:12

@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(:(:

P#126772 2023-03-08 07:43
1

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

P#126776 2023-03-08 09:15
2

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.

P#126775 2023-03-08 11:53 ( Edited 2023-03-08 11:54)

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

P#126781 2023-03-08 12:07
2

@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.

P#126788 2023-03-08 16:11

@dw817 WAAAAAAT!?!? 🤯🤯🤯🤯🤯

P#126792 2023-03-08 17:01

@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.

P#126836 2023-03-09 07:26

@samhocevar That's also interesting and unexpected!

P#126842 2023-03-09 13:34

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.

P#126857 2023-03-09 16:40

@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!

P#126903 2023-03-10 10:31

[Please log in to post a comment]