Images
An image is a node with content.type: "image" and role: "image". The engine does not read width or height from the file — you declare them in content.value as millipt (1 pt = 1000).
Copy ex_image.json into content/root.json children (keep id: "root" on the document; the catalog file is a small section, not a full root). Put the bytes at value.src under assets/images/ before k2f pack.
Asset files
| Rule | Detail |
|---|---|
| Path | Package-relative under assets/images/ only (not the assets/ root) |
src | Field name is src, not path; not an http:// URL |
| Formats | PNG, JPEG, WebP, SVG — not GIF |
| SVG text | Rasterized without system fonts. <text>, <tspan>, <textPath>, and <foreignObject> fail at pack — use <path> or a sibling K2F text node |
Node shape
content.value.src,width, andheightare requiredwidth/heightare the declared paint size (millipt), not CSS pixelsroleis usuallyimage; starter theme already defines that role
Fit and alignment
In a vertical stack, default align_items is stretch: the image box spans the content width; the bitmap is painted inside it.
- Contain (default): letterbox, centered — role
image_fitomitted orcontain - Cover: center-crop into the box — node
variant: "cover"on roleimagein the starter theme - Left / right: set
self_aligntostartorendon the role instyles/theme.json, not on the node
Do not put image_fit or self_align on the image node. See Theme and fonts.
See also (catalog)
| Need | File |
|---|---|
| Fixed-width figure + flowing copy | ex_media_row.json (grid) |
| Title + logo / trailing image | ex_split_bar.json |
| Full-bleed background image | ex_overlay.json (layout) |
Allowed keys
Allowed keys (image row) and nodes.schema.json.
Common mistakes
- Omitting the file under
assets/images/before pack - Using CSS
pxor raw pixel numbers instead of millipt - Putting declared
width/heightonlayoutinstead ofcontent.value - Putting
image_fitorself_alignon the node instead of the theme role - GIF assets or external URLs in
src - SVG that still contains live text tags