Minification (Pico-8)

Shrinko8 - an aggressive cart minifier (+ linter & other tools) - online / lexaloffle

  • Tokens: 8192
  • Characters: 65’536
  • Compressed Code Size: 15’616

Compression limit

Because there is a small, fixed amount of space available to encode the cart in the image, PICO-8 uses compression to reduce the size of the cart’s source code. The compressed code size must be under a certain limit for the save to succeed. As of 0.2.2c, this limit is 15,616 bytes.

PXA File Format

pico8 stores its cartridges in a custom compressed format called PXA. basically, it stores data in chunks. each chunk is a specific type, CHR, REF, or RAW

coming up with new ways to make my code horrific but slightly smaller when compressed:

  • changing all my loops (e.g. for j=1,8 do) to use the same index variable (j) and start number, so that the loop header compressed neatly into a larger REF chunk.
  • don’t store variables if you can help it. writing x=stat(32) to get the mouse’s xpos and then using it ~6 times was 1 byte longer than just calling stat(32) 6 times. surprising!

see also PXAVizualiser

see also

Written on October 30, 2025, Last update on
pico8 zip