image2tiles.py
Aquarius+ tile generator utility.
Overview
image2ties reads an image file and generates Aquarius+ tilemap asset files.
Source Image
- Can be in any format supported by the Python Pillow module, including BMP, DIB, GIF, JPEG, PCX, PNG, and TIFF.
- May be of arbitrary size, but the image width and height in pixels must both be a multiple of 8.
- Should contain no more than 16 unique colors.
Generated Asset File Types
Tileset (.tile)
Tile definitions as stored in Video RAM.
The tile definitions start at tile index 128 unless otherwise spceified by the -s
(--suffix
) parameter.
The first tile generated will be blank unless overridden by hr-b
(--blanktile
) parameter.
- A blank tile is one in which all pixels are set to color index 0.
- If the specified blank tile index falls within the range of generated tiles, the tile at that index will be set to blank.
- Otherwise, the Generated tile set will not contain a blank tile.
The tiles are generated by dividing the image into 8 pixel by 8 pixel squares which are processed sequentiallt from left to right.
- The 24-bit RGB value of each pixel in the square is converted to a 12-bit Aquarius+ RGB color.
- The corresponding pixel in the tile definition is set to the color index of the converted RGB value in the palette.
The tileset can be loaded into Video RAM using
LOAD TILESET INDEX start_tile,"imagename.tile"
in plusBASIC
- or with kernel routine file_load_tileset in assembly language.
Virtual Tilemap (.vmap)
Tilemap with the same geometry as the source image.
Tilemap (.tmap)
Aquarius+ compatible tilemap file.
Palette (.palt)
Palette the tiles in the tilemap.
CLIP
Tileclips (for use with plusBASIC commands and/or kernel routines)