faceless-photolib

Migrating: Krita (.kra)

Krita best-effort import scope and policy, with the generated compositeop-mapping fidelity table.

Generated from code

The import-krita package has landed. The compositeop fidelity table below is generated at build time from that package's real mapping table (task 5.1) — a mapping change updates this page on the next site rebuild, with no manual doc edit.

Policy

Krita import follows the same shared policy documented in full on the OpenRaster guide: best-effort raster-safe subset, a data (not prose) fidelity report with mapped | degraded | dropped verdicts, source preservation of the original .kra as a role: "master" blob, and content-based (not filename-based) detection — a .kra file is distinguished from an .ora file by zip-member sniffing: the presence of maindoc.xml versus an ORA mimetype member, never by extension.

Scope

Per design D6, this is deliberately the most constrained of the four importers:

  • Parse maindoc.xml for the layer tree.
  • Where layer pixel data is available as embedded, already-rasterized content (file layers, some paint layers) — use it directly, mapped.
  • Otherwise, per layer: use a derivable visible-flatten of that layer if one exists, else drop the layer with a dropped verdict naming it — never a silent omission from the resulting document.
  • Krita's internal tile format is explicitly out of scope. Attempting a from-scratch Krita tile-codec implementation is, per the design's consultant consensus, the textbook edge-case tar pit this format's import policy is built to avoid — it's a "best-effort raster subset," not "full Krita fidelity."

What this means in practice

A Krita document with straightforward paint layers and groups should import cleanly (mapped). A document leaning on Krita-specific features the importer doesn't understand — vector layers backed by Krita's own vector format, filter layers, complex tile-encoded brush strokes it can't flatten — will surface those as degraded or dropped items in the pre-commit fidelity dialog, and the original file is always recoverable from the stored source blob regardless of what the import kept.

Blend-mode mapping (generated from import-krita)

Krita's compositeop vocabulary (KoCompositeOpRegistry.h) is package-local to @faceless-photolib/import-krita (mapKritaCompositeOp) — it is NOT the shared ORA/PSD table, because Krita's 100+ op registry mostly has no blend-function equivalent. Every one of the native 27 modes does have a Krita id (note the registry's own spellings: burn, dodge, luminize, diff). This table is rendered from that exact code at build time; the degraded row shows representative exotic ids — any unmapped id degrades to normal the same way, never a nearest-match guess:

Krita compositeopNative modeVerdict
normalnormalmapped
dissolvedissolvemapped
darkendarkenmapped
multiplymultiplymapped
burncolorBurnmapped
linear_burnlinearBurnmapped
darker colordarkerColormapped
lightenlightenmapped
screenscreenmapped
dodgecolorDodgemapped
linear_dodgelinearDodgemapped
lighter colorlighterColormapped
overlayoverlaymapped
soft_lightsoftLightmapped
hard_lighthardLightmapped
vivid_lightvividLightmapped
linear lightlinearLightmapped
pin_lightpinLightmapped
hard mixhardMixmapped
diffdifferencemapped
exclusionexclusionmapped
subtractsubtractmapped
dividedividemapped
huehuemapped
saturationsaturationmapped
colorcolormapped
luminizeluminositymapped
erase, copy, grain_merge, grain_extract, greaternormaldegraded

Corpus samples

Every Krita fixture in the sample corpus is served through the same /api/samples/<id> proxy every other demo on this site uses; no direct storage URL ever appears in this page. "Open in editor" runs the real import pipeline end to end, fidelity dialog included.

Samples — import-krita
Run checks in Test Lab

Preparing sample list…

Next

OpenRaster · Photoshop · Flat images