Skip to content

Asset converter (PNG → Bitmap)

Open the asset converter → — drop a PNG, pick how it’s laid out, download the .py module. Nothing leaves your browser.

It is the web twin of tools/png2picogame.py and produces the same module, byte for byte (a golden test keeps them in sync): a .py with the pixel data, palette and a bitmap(pg) helper.

  • Sprite sheet — frames side by side (--frames N); tileset — any grid, repacked to a strip (--tile WxH), with dedup of identical tiles up to rotation/mirror and a REMAP table for your tilemap; single image — a background.
  • PAL8 or RGB565 — auto picks PAL8 when the art has ≤ 255 colours (1 byte/pixel; that’s what you want on an RP2040). Max colours + dither for photos/gradients. RLE for a big single PAL8 background (small module, inflates on load).
  • Transparency — alpha, the top-left pixel’s colour, magenta #F800F8, or none.
  • RAM readout — the exact heap cost of the Bitmap on the device, with a warning when it’s a lot for an RP2040 (~138 KB heap in total).
  • ▶ Try in playground — opens the playground with the asset on screen (frames cycle; LEFT/RIGHT step) so you see it rendered by the real engine before you copy anything.

Source: tools/assets/ — a static app sharing the editor’s core.js.

Put my_sprite.py next to your code.py (or precompile it with tools/build_mpy.sh), then:

import my_sprite
bm = my_sprite.bitmap(pg) # a picogame.Bitmap (frames from the sheet)
spr = pg.Sprite(bm, 100, 80)
spr.frame = 2

For a scene made in the level editor you don’t need this at all: Export → baked <name>_scene.py bakes every imported PNG in place and gives you a module ready for picogame_scene.load(pg, level1_scene.SCENE).