A command-line utility that converts GIMP palette files (.gpl) to assembly include files (.inc) for retro programming and palette-based systems.
gpl2asm reads color palettes in GIMP's palette format and converts them to assembly language DB (Define Byte) directives. The tool automatically converts 8-bit RGB values (0-255) to 6-bit RGB values (0-63), which is the standard for VGA mode 13h.
- Converts GIMP palette files to assembly include files
- Automatic 8-bit to 6-bit RGB color conversion
- Cross-platform support (Linux, Windows, macOS)
- Available as standalone binary or Docker container
Download the latest release for your platform from the releases page.
docker pull ghcr.io/laghoule/gpl2asm:latestOr from Docker Hub:
docker pull laghoule/gpl2asm:latestRequires Go 1.25.6 or later:
git clone https://github.com/laghoule/gpl2asm.git
cd gpl2asm
go buildgpl2asm --src input.gpl --dst output.incIf no arguments are provided, it uses pal.gpl as input and pal.inc as output:
gpl2asm--src <file>: Path to the GIMP palette file to convert (default:pal.gpl)--dst <file>: Path to the output assembly include file (default:pal.inc)
docker run -v $(pwd):/data ghcr.io/yourusername/gpl2asm:latest \
--src /data/input.gpl --dst /data/output.incThe tool expects GIMP palette format (.gpl files):
GIMP Palette
Name: My Palette
Columns: 16
#
0 0 0 Black
255 255 255 White
255 0 0 Red
0 255 0 Green
0 0 255 Blue
Each color line consists of:
- Three integers (0-255) representing RGB values
- A name or comment for the color (can include spaces)
The tool generates assembly include files with DB directives:
palette LABEL BYTE
DB 00,00,00 ; Black
DB 63,63,63 ; White
DB 63,00,00 ; Red
DB 00,63,00 ; Green
DB 00,00,63 ; BlueNote that RGB values are automatically converted from 8-bit (0-255) to 6-bit (0-63) by dividing by 4.