Image API Reference
kittl.design.image — add and update raster images.
Scope: design:state:write
addImage(params)
Adds a new image to the canvas.
| Property | Type | Required | Description |
|---|---|---|---|
src | string | Conditional | Image source URL or objectName; omit only when providing both width and height |
width / height | number | Conditional | Required together when src is omitted |
position | AbsolutePosition | RelativePosition | Yes | Placement on canvas |
size | { width, height, applyViewportScale? } | No | Dimensions |
objectProperties | ImageProperties | No | Optional styling (angle, flip, opacity, fill, stroke, shadow) |
Returns: SdkResultAsync<NormalizedIllustrationImageObject>
updateImage(params)
Updates properties of an existing image.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the image to update |
left | number | No | X position |
top | number | No | Y position |
width | number | No | Width in pixels |
height | number | No | Height in pixels |
objectName | string | No | Image source reference |
stroke | string | null | No | Stroke color |
strokeWidth | number | No | Stroke width in pixels |
shadowOptions | object | No | Full shadow configuration |
shadowColor | string | null | No | Shortcut to set just the shadow color |
ImageProperties
Optional styling properties passed via objectProperties when adding an image:
| Property | Type | Description |
|---|---|---|
angle | number | Rotation in degrees |
flipX / flipY | boolean | Flip horizontally/vertically |
hidden | boolean | Visibility |
opacity | number | Opacity (0–1) |
fill | ColorInfo[] | Fill array (each entry has key, value, visible) |
stroke | string | null | Stroke color |
strokeWidth | number | Stroke width in pixels |
shadowOptions | object | Shadow configuration |
updateImageSource(params)
Replaces an image's stored source.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Image ID |
objectName | string | Yes | New stored image source |
keepObjectDimensions | boolean | No | Keep the existing object dimensions |
flatten | boolean | No | Flatten the source during replacement |
See UpdateImageSourceParams for all options.
resetImageCrop(params)
Resets the crop for the image identified by { id: string }. See ResetImageCropParams.
resetImageBackgroundRemoval(params)
Resets background removal for the image identified by { id: string }. See ResetImageBackgroundRemovalParams.
These methods return SDK results; check isOk before using the updated object. Their exact result types are listed in the image API inventory.