Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+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 ! :)