Skip to content

Gimp palette format extensions

Ilya V. Portnov edited this page Aug 22, 2016 · 1 revision

Gimp palette format (.gpl) is pretty simple, but it can be easily extended without losing compatibility. Syntax of .gpl file defines, that any line starting with # sign should be considered as comment and ignored. Palette_editor uses comments to store metainformation in .gpl files.

Marker

After standard .gpl file header, palette_editor puts fixed line:

# Colors not marked with #USER are auto-generated

When reading .gpl file, palette_editor checks for this line to detect that file was written by palette_editor.

Palette metainformation

After marker, palette_editor puts metainformation attributes of palette in "# Name: Value" format:

# URL: http://paletton.com/#uid=1000u0kllllaFw0g0qFqFg0w0aF
# Name: 5 reds

User-defined slot marker

In palette_editor's palette, each color slot can be either user-defined or automatically generated. To indicate, which slots were defined by user, palette_editor puts "# USER" comment at end of line with color:

170 57 57 Untitled #USER

All colors without this mark are considered as automatically generated.

Color metainformation

After each line with color, palette_editor puts color metainformation in "# Name: Value" format:

180 39 39 Reddish #USER
# Author: Ilya Portnov