BMP2Tile remade for macOS
A native Apple Silicon reimplementation of maxim-zhao/bmp2tile, the tool for converting images to Sega Master System tiles, tilemaps and palettes. C++20, SDL3, Dear ImGui — ought to build on other platforms but untested. A full reimplementation, not a line-by-line port of the original C#.
Unsigned build — macOS will probably block it on the first run. There should be an allow option in System Settings -> Privacy and Security.
What it does
Loads a BMP, PNG, or GIF image, preserving the original palette order. Chops it into 8×8 tiles with duplicate and mirror detection, then saves tiles, tilemap and palette in a variety of SMS formats.
Compression formats
There are encoders for every format that devkitSMS has a decoder for. If anyone would use any of the other formats supported by the original, give me a shout and I'll add them, I was just reluctant to add anything I didn't have the means to test. ZX7, PSGaiden, STC0, STC4 and STM should all match the original's output byte for byte. APLib is a hybrid — the bitstream format is faithfully ported, but the match finder is a from-scratch hash-chain/greedy parser rather than the original's optimal suffix-array search, so it produces a larger but fully correct bitstream (I don't use it personally, and this is way smaller than the optimal solution).
Additions from the original
Tilemap and palette entries can be dragged to rearrange (although you probably want your build process to be reproducable without manual re-ordering, I thought it would be useful for quick tests).
Building it
The Makefile can create a CLI version, GUI version, or app bundle:
xcode-select --install # install the XCode command line tools
make cli # no network access, SDL or Dear ImGui dependencies
./build/bmp2tile_cli --help
brew install sdl3 pkg-config
make gui # fetches Dear ImGui on first run
./build/bmp2tile
make # both
make bundle # wraps bmp2tile in a double-clickable .app
- C++20
- SDL3
- Dear ImGui
- Apple Silicon
- SMS / Game Gear