Design kit command
image.place
Place image
Places an image from base64 or a path as a new image layer, or adds it as a fill on an existing layer.
- Kit
- Design 0.1.0 (.kdesign)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
data | string | no | |
height | number | no | |
index | integer | no | a position counted from 0 (the first is 0); with `target`: fill `index` becomes the image in place, keeping its opacity, blend and visibility and, when it is an image already, its scale mode, tile scale, rotation and adjustments |
mode | "fill" | "fit" | "crop" | "tile" | no | |
name | string | no | the image's name |
parent | integer | string | no | an id (a number, or its digits as text) |
target | integer | string | no | an id (a number, or its digits as text) |
width | number | no | |
x | number | no | |
y | number | no |
Call through design_run
text
design_run {
"path": "<file>.kdesign",
"steps": [{ "command": "image.place" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: data, height, index, mode, name, parent, target, width, x, y. design_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
json
{
"additionalProperties": false,
"properties": {
"data": {
"type": "string"
},
"height": {
"type": "number"
},
"index": {
"description": "a position counted from 0 (the first is 0); with `target`: fill `index` becomes the image in place, keeping its opacity, blend and visibility and, when it is an image already, its scale mode, tile scale, rotation and adjustments",
"type": "integer"
},
"mode": {
"enum": [
"fill",
"fit",
"crop",
"tile"
],
"type": "string"
},
"name": {
"description": "the image's name",
"type": "string"
},
"parent": {
"description": "an id (a number, or its digits as text)",
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-khp-types": [
"Node"
]
},
"target": {
"description": "an id (a number, or its digits as text)",
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-khp-types": [
"Node"
]
},
"width": {
"type": "number"
},
"x": {
"type": "number"
},
"y": {
"type": "number"
}
},
"returns": "{id, image, width, height, imageProfile (its embedded colour profile; null: taken as sRGB)}",
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (design_commands through @kition/[email protected], built from KitionAI/kition-design@abc7e16). As data: commands.jsonl.