A downloadable tool for Windows

Get this tool and 3 more for $6.49 USD
View bundle
Buy Now
On Sale!
40% Off
$2.89 $1.73 USD or more

English - Version en Français, en bas de page

Hello Pico-8 users!

If you've made it here, it probably means you're already familiar with Pico-8, a wonderful virtual console for making, sharing and playing tiny games and other computer programs. This fantasy machine is intentionally limited by design to simulate the harsh hardware limitations of the video game consoles around the 1980s.

As you may know, Pico-8 games are limited to:
- a 128x128 pixel, 16-color display.
- 8k of commands (or "tokens")
- 256 8x8 sprites
... and these restrictions can be difficult to deal with!

Whether you are on the Pico-8 programming side, or are interested in image processing or low resolution image compression, Image-To-Pico8 software can generate images for you, easily and quickly.
It will save you time!

A simple 128x96 image will take nearly all the space available if you copy it as ‘Sprite data’. If you want to optimize the occupied space, you need to store your image somewhere else, like in the ‘Map data’. This page will show you how to convert an image to pico-8 while optimizing its size.

Convert an image into pico-8 optimizing its size

Image-To-Pico8 (or “ImgToP8”) is an utility software when you don’t use the Map section in your Pico-8 cartridge, that is to say, you don't use the 3rd tab ("map") in Pico-8:

The map section is useful when you deal with level design or data layout. However if your game is not a platformer or a top-down shooter, chances are that this part will stay empty.

The purpose of ImageToPico8 software is to use this empty unused space to optimize your Pico-8 cartridge. It will make it possible to process and convert your images to pico-8 map data.
ImageToPico8 converts any PNG, JPG, BMP, PCX image into 4-color bitmap usable in pico-8. It optimizes the cartridge space, by not using the sprite tab of the cartridge.

Example images - Conversion results

woman face from thispersondoesnotexist code to convert image into pico8 map data

mountains landscape p8 code to convert mountains picture into pico8 map data

To draw such image, you may think the most straightforward method is to use sprites.
If you use the sprite tab to store a 128x96 image, it will take 192 slots of the 256 slots available (each slot being a 16-colors and 8x8 pixels sprite). That is equal to 6 kbytes and leaves you only 2 kb (32 slots) to draw 32 sprites.
But if your image has only 4 colors, you can store 4 pixels in one byte, which means total image data will only weigh 3 kb. Furthermore, if you don’t plan to use the map tab, you can fully store these 3k of image data as “map data”, that is to say, in the __map__ section of your p8 file. This leaves you the sprite tab fully available, which corresponds to a capability of drawing 128 sprites.
Since you were not using map tab, you've just saved the equivalent of 192 sprites of cartridge space!

How to convert your image into pico-8 map data with ImageToPico8

The process can be divided in 3 steps:

First Buy Now to download ImageToPico8.
  1. Launch ImageToPico8 : Preview and convert your image -- you will have the possibility to preview the result of your conversion, in any 4-color palette you want.
    For example, type:     ImgToP8 "D:\My folder\MyPhoto.jpg"

  2. Copy and paste the result, in your cartridge, as Pico-8 map data.

  3. Use one of the code samples to display the image. This is done in Pico-8 by accessing directly to the map data (in virtual console memory) with POKE function.
    Detailed how-to and image conversion examples here

Make lively animations

 
To make GIFs like these ones, you may use ImageToPico8 and batch several image processes:
You can use the flag -gif to process the image file several times and generate an animated GIF out of it!
You can also use the flag -repeat and -still to generate multiple still images.
For example, type:

ImgToP8 -orange -gif "C:\my\path\myfile.jpg"

...or for still images:

ImgToP8 -blue -repeat10 -still "C:\my\path\myfile.jpg"

Games made using Image-To-Pico8 converter

background image and animation made thanks to ImageToPico8
The background image and its animation has been created thanks to Image-To-Pico8. The image pixels are stored in the Map tab. The code of the display and its juicy cosine offset-x animation is a variation of this example of code: display and animation.
Game: Invasion Commander

Pico8 Tracker music - song cover

pixel song cover for Pico-8 music tracker
If you make music with the Pico-8 Tracker, you could wish to use a pixelated image for your song cover. That’s what they did in the example above as they used ImageToPico8. They used to a custom palette involving original pico8 colors 1,3 and alternate colors 129,131 making the final palette "129,1,131,3". To achieve this, type:

ImgToP8 -dw128 -dh128 -pc129,1,131,3 "C:\my\path\myfile.jpg"

How to setup a custom palette or use a palette preset.

Full options list to convert images

- Image-To-Pico8 complete options list.

License

In short, if you purchased "Image-To-Pico8" software, Anto80 allows you to use it to produce images for multiple projects, whether commercial or non-commercial. Full license terms.

Credits

- Special thanks to Pico-8 by Lexaloffle Please kindly note that Image-To-Pico8 (ImgToP8) is independent software, not affiliated with Pico-8 by Lexaloffle

Images:
- Man standing on stone looking at sunset : Joshua Earle https://unsplash.com/@joshuaearle
- Landscape photography of brown mountains : Sergey Pesterev https://unsplash.com/@sickle
- Electro man head : Hailey Reed https://unsplash.com/@haileysreed
- Smiling grayscale woman with straight hair, Grayscale woman with blonde curly hair, Blue palette man, and Glitched Woman with cap in pink and purple palette : "This Person Does Not Exist" www.thispersondoesnotexist.com
- Gray Cat : Cedric VT https://unsplash.com/@cedric_photography
- Woman in glasses (Color Cycling) : Max Ilienerwise https://unsplash.com/@ilienerwise
- Photography of house near body of water, twilight sunset : Justin Bisson Beck https://unsplash.com/@justinbissonbeck
- Landscape photo of black rock formation on body of water near seashore : Benjamin Behre https://unsplash.com/@hellothisisbenjamin

Français

Bonjour à toute la communauté francophone Pico-8 !

Si vous êtes du côté de la programmation Pico-8, ou si vous vous intéressez au traitement d'image ou à la compression d'image en basse résolution, ce logiciel Image-To-Pico8 peut vous produire des images facilement, rapidement et ainsi vous faire gagner du temps!

- Pour vous rendre service, les exemples de code en Français sont aussi disponibles.
- Vous pouvez aussi consulter la page de Image-To-Pico8 en Français.
- Liste complète des options de conversion de Image-To-Pico8.

Licence: En bref, si vous avez acheté le logiciel "Image-To-Pico8", Anto80 vous autorise à l'utiliser pour générer des images pour autant de projets que vous voulez, qu'ils soient commerciaux ou non. Conditions d'utilisation complètes.

[Haut de la page] - Version en anglais

Purchase

Get this tool and 3 more for $6.49 USD
View bundle
Buy Now
On Sale!
40% Off
$2.89 $1.73 USD or more

In order to download this tool you must purchase it at or above the minimum price of $1.73 USD. You will get access to the following files:

image-to-pico8-converter-windows.zip 723 kB
Version 1.732

Development log

Comments

Log in with itch.io to leave a comment.

So I got this tool as a part of the pico-8 premium bundle, and I deeply want to use it, but I use mac and can't, is there any way to use it on here?

Hello, 
There is no version dedicated to Mac or Linux, sorry.
However, as a workaround:
- On Linux you can use wine to run it (Shortround here below in the comments tested on it worked fine)
- On Mac, I don't know if there are similar tools or virtual machine to do the same trick.

I'm not very technologically advanced, nor do I remember well what I do know about making pico-8 carts, but can't you export to any platform you want, and if you can't, can't you just get the plain cartridge?

(1 edit)

When you create something on Pico-8, yes, you can export as ".p8" cartridge, or export to Windows/Linux/Mac executable, or even to a HTML5 page playable in browser.

However Image-To-Pico8 Converter is not a Pico-8 cartridge. It's written in C++/Allegro (and not in Lua) and it can be run only on Windows.

So no, i can't.

Well, thanks for the help!

Hi Anto, I am having some trouble getting image to pico8 converter to work on my computer.  I am using Windows 10, and the program crashes before opening.  Would you happen to know of a way that I might be able to fix the application to run?  Thanks!

(1 edit)

Hi Nick, 

I'm using Windows 10 too. 

Did you open a Windows Console? Could you check the troubleshooting section here: https://anto80.com/en-us/image-processing/imagetopico8-image-convert-options-lis...

If you still have the problem, could you share a screenshot of the error message?

Edit: Do you have administrator privileges on your machine?

Thanks

(+1)

Hey Anto,

Thanks a lot for your help!  This is exactly what I needed.  I got the program running in the Command Prompt now!  I am looking forward to using it.


Thanks :)

(+1)

Great utility, works perfectly on linux using wine, so if you're a linux user, this will work great for you

Thanks for your feedback on Linux! I greatly appreciate! :) 

And thanks for your nice words about the image utility itself! I'm pleased you like it!

(+1)

This is a wonderful utility! Thank you for making it.

If possible, could you please add some code samples for putting GIF images into P8 files, or for "faking" the GIF effect in P8? Your other tutorials are good, but I did not see anything like this.

(1 edit) (+1)

Thanks for your support and nice words!

I appreciate your feedback! Sure! In fact, such still pictures/examples with associated commands and the results would be an improvement.  About how to provide them, maybe an online "recap" page, as well as a downloadable separate example zip, with images full credits/source.

Also, I'd like to keep all my examples license-free, that is why I use resources from websites like unsplash.

As for converting images into animated p8, only the cosine example provided exists for now. I didn't include p8 code to simulate the noise effect because if your GIF has n frames, it would require n times the space in map data section, and I can't think about an elegant and compressed way to achieve this for now.

(+1)

Hey Aeneas Nin !

Further to your comment about “faking the GIF effect” in P8, I have been thinking for a long time how I can workaround this issue. I’m glad to tell you that I now have a solution as “P8 code” ! (along with the existing feature which creates GIFs)

Latest version now produces Pico8 lua code (in __lua__ section of the p8 file) which integrates a small program to display the image on Pico8 screen. This includes a list of “changing pixels” calculated by ImageToPico8 and then drawn on Pico8 side. The rendering of these innerstate noise pixels simulates the animation of the image.

In my first experiments, I was storing pixels as {x,y} coordinates. Then, I decided to store only the address (number between 0 and 16384 for a 128x128 screen) to save 50% of the tokens. Finally, what is ultimately stored are the differences between the current address and the previous address, thus saving some bytes. 

This new feature takes “87+n” tokens: one token for each “changing pixel” you want to draw (“n”) and 87 tokens for the built-in program itself.

  • You can adjust the number of tokens to allocate in your final p8 file (with the option -noisetokensNNNN : Allocate NNNN tokens of Pico-8 code) default is 2000 tokens = 1913 pixels.
  • You can remove comments in Pico-8 code to reduce byte size (“--” keywords) with option -nocommentsp8 

I would love to have your feedback on this update. If you like it, the RT of this tweet would be much appreciated ! Thanks ! :)