krita_set_selection
Set or modify a document selection by replacing, adding, subtracting, or intersecting with a rectangle or polygon defined in pixel coordinates.
Instructions
Replace or combine the selection with a bounded rectangle or polygon in image pixels. Rectangle requires only x/y/width/height; polygon requires only 3–256 integer points. Selection bounds must fit the canvas and 16 megapixels. No guaranteed undo transaction.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"instance_id": "<instance_id>",
"operation_id": "<operation_id>",
"document_id": "<document_id>",
"shape": "<shape>"
},
"name": "krita_set_selection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| mode | No | replace | |
| shape | Yes | ||
| width | No | ||
| height | No | ||
| points | No | ||
| document_id | Yes | ||
| instance_id | Yes | ||
| operation_id | Yes |