Skip to content
ZapskiRetro

Game Boy tile converter

Turn a PNG into Game Boy tile data and a tile map, ready to paste into a GBDK or RGBDS project, or turn raw tile data back into a picture you can look at.

Direction

Choose a PNG, drag one onto this box, or paste one.

Format

Everything happens in your browser. Your files are never uploaded.

How it works

A Game Boy draws everything from 8×8 pixel tiles in four colours. Each tile is 16 bytes: two bytes for every row, one holding the low bit of each pixel's colour and one holding the high bit. That format is usually called 2bpp, for two bits per pixel.

The converter reduces your image to four colours, cuts it into tiles, and writes them out. A picture that already uses four colours or fewer keeps them as they are, lightest as colour 0; anything else is sorted into four bands by brightness. If the same tile appears more than once it is stored once, and the tile map records which tile goes in each position.

Going the other way, raw tile data has no width of its own, so you choose how many tiles to draw across. Sixteen suits most tile sheets; change it until the picture lines up.

Using the output

In GBDK, load the tiles and draw the map as a background:

set_bkg_data(0, TILES_TILE_COUNT, tiles_tiles);
set_bkg_tiles(0, 0, TILES_MAP_WIDTH,
              TILES_MAP_HEIGHT, tiles_map);

In RGBDS, copy the bytes between the Tiles and TilesEnd labels into video memory, then the map. The binary option saves the same bytes as files for INCBIN.

Limits

  • A background can use 256 different tiles, and an original Game Boy holds 384 in total. The tool warns you past either.
  • Sizes that are not a multiple of 8 are padded with colour 0 on the right and bottom.
  • This is for backgrounds and tile sheets. It does not write sprite metadata or Game Boy Color palettes; GBDK's png2asset is the tool for those.
  • To draw tiles, or edit ones already in C, use the sprite editor.

More tools