Join us on Discord!
You can help CodeWalrus stay online by donating here.

[PICO-8][Tutorial] How to import pictures into PICO-8

Started by Yuki, May 01, 2015, 05:52:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yuki

I made a little script that converts a picture into a PICO-8 cartridge. Here how it works:

1. Install PHP and its GD library. Works best on Linux and OS X, but can also work on Windows.
2. Download this pic2p8.php script and run it like this:
php pic2p8.php mypic.jpg
3. Copy the output into a new file with a .p8 extension into your cartridge folder. (Type folder in the PICO-8 prompt, or for you Linux users do this:)
php pic2p8.php mypic.jpg > ~/.lexaloffle/pico-8/carts/mypic.p8
4. Now you can load the cart and run it in PICO-8 already as it have some simple code to show it.

If you're not satisfied with the result you can always try GIMP:

1. Download PICO-8.gpl and put it in GIMP's palette directory.
2. Create or resize an existing picture in 128x128 and modify it however you like.
3. Go to Image > Mode > Indexed colors > Use a custom palette > PICO-8, uncheck Remove unused colors from palette, click OK.
4. Now export the resulting picture and run it through the above script.

Now that you have a full-screen picture, you can do interesting stuff with it, play some music on it or whatever... Have fun!
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

Oh interesting stuff. Is that also useful to import sprites or can we already import spritesheets by default?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Duke "Tape" Eiyeron

What does it do as DJ says? Does it override the spriteaheet? That could be very useful!
  • Calculators owned: A lot.

Yuki

Yeah, you can always design your sprites in GIMP, then use the script to generate a new cartridge. You can't import into an existing cartridge yet, unless you open it and copy the spritesheet with a text editor.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Duke "Tape" Eiyeron

That's pretty cool, let's hope you'll be able to edits carts for such tools! :D
  • Calculators owned: A lot.

Yuki

A cart editor tool script would be indeed pretty interesting.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

That is nice. I prefer using my own editing tools personally, such as how with 84+CSE or HP PPL games I design all my sprites in Photofiltre Studio before importing them.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Duke "Tape" Eiyeron

I thought also to make a custom cart repository as an exercise to get my hands on Flask. It could be a cool thing to do.
  • Calculators owned: A lot.

Powered by EzPortal