color_tools.exporters.gpl_exporter

GIMP Palette (.gpl) format exporter.

Exports colors to GIMP Palette format, which is a simple text format used by GIMP, Inkscape, Krita, and other graphics applications.

Format specification:

GIMP Palette Name: palette_name Columns: 0 # R G B Color Name 255 127 80 coral …

This exporter demonstrates how to add support for third-party formats to the color_tools export system.

class color_tools.exporters.gpl_exporter.GPLExporter[source]

Bases: PaletteExporter

GIMP Palette (.gpl) format exporter.

Exports colors to the GIMP Palette format, which is supported by:
  • GIMP (GNU Image Manipulation Program)

  • Inkscape

  • Krita

  • MyPaint

  • Other graphics applications

Format features:
  • Plain text format

  • RGB color values (0-255)

  • Optional color names

  • Header with palette name

Note: This exporter only supports colors (not filaments), as the GPL format is designed for color palettes used in graphics applications.

Example

>>> from color_tools.exporters import get_exporter
>>> exporter = get_exporter('gpl')
>>> from color_tools.palette import Palette
>>> palette = Palette.load_default()
>>> # Export first 10 colors as a GIMP palette
>>> path = exporter.export_colors(palette.colors[:10], 'my_palette.gpl')
property metadata: ExporterMetadata

Return metadata describing this exporter’s capabilities.

Returns:

ExporterMetadata instance with name, description, capabilities