color_tools.exporters.kpl_exporter
Krita Palette (.kpl) exporter.
Exports color palettes to Krita’s native KPL palette format.
KPL is a ZIP-based palette container containing:
mimetype colorset.xml profiles.xml [optional ICC profiles]
The mimetype file contains:
application/x-krita-palette
This exporter currently writes built-in sRGB swatches using 8-bit source values. Because built-in sRGB does not require an embedded ICC profile, profiles.xml is written as an empty profile manifest.
Palette-aware export preserves:
name
description
preferred column count
Author, tags, and arbitrary properties are not currently represented because the KPL Colorset structure does not define standard fields for them.
Colors are placed sequentially into the KPL grid in row-major order.
- class color_tools.exporters.kpl_exporter.KPLExporter[source]
Bases:
PaletteExporterExport color palettes in Krita Palette (.kpl) format.
Krita’s native palette format supports color-managed swatches, groups, arbitrary grid positioning, multiple color spaces, spot colors, and embedded ICC profiles.
This exporter currently targets the subset represented by ColorRecord:
ungrouped colors
built-in sRGB
U8 bit depth
non-spot colors
sequential grid positioning
Palette metadata is used for the KPL palette name, description, and grid column count.
- MIMETYPE = 'application/x-krita-palette'
- FORMAT_VERSION = '1.0'
- DEFAULT_COLUMNS = 16
- property metadata: ExporterMetadata
Return metadata describing the KPL exporter.