Layer types
kimg supports seven layer types:Image
An RGBA buffer with optional non-destructive transforms (position, rotation, scale, flip).Paint
An editable RGBA buffer. Use this for layers that need pixel-level editing with tools like bucket fill.Filter
A non-destructive adjustment layer that applies HSL, brightness, contrast, temperature, tint, and sharpen adjustments to all layers beneath it.Group
A container for organizing child layers. Groups can be nested and support scoped filter application.SolidColor
A flat color fill that spans the entire canvas.Gradient
A linear color gradient fill with customizable stops and direction.Shape
A rasterized vector-style shape primitive (rectangle, rounded rectangle, ellipse, line, polygon) with fill and stroke styling.Common layer properties
All layers share these properties:| Property | Type | Description |
|---|---|---|
id | number | Unique identifier assigned when the layer is created |
name | string | Human-readable layer name |
visible | boolean | Whether the layer should be rendered |
opacity | number | Global opacity multiplier (0.0 to 1.0) |
x, y | number | Position offset from the top-left of the canvas |
blendMode | string | How this layer blends with content below it |
mask | ImageBuffer | Optional grayscale mask (white = visible, black = hidden) |
maskInverted | boolean | Inverts the mask luminance |
clipToBelow | boolean | Clips this layer to the alpha of the layer directly below it |
Updating layers
UseupdateLayer() to modify layer properties: