modify_selection
Expand, contract, border, feather, smooth, invert or harden a saved selection channel. Refused if the target channel already confines a filter.
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": {
"image": "<image>",
"channel": "<channel>",
"op": "<op>"
},
"name": "modify_selection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | expand/contract/border/feather require `px` (> 0). harden: threshold a soft mask at 50%. smooth: round off jagged edges (`px` optional, floors at 1px). | |
| px | No | Radius in document pixels, rounded to the nearest whole pixel. Required (> 0) for expand/contract/border/feather; optional for smooth; unused otherwise. expand/contract/border cap at 150 on an ordinary document, LOWER on a very large one (morphological ops whose cost scales with both the radius and the document's own megapixels — the error names the actual cap for that document when a value is refused); feather has no such cap up to 1000 (a blur, flat cost regardless of radius). | |
| image | Yes | Image id, as returned by open_photo. | |
| output | No | Write to this saved selection instead of modifying `channel` in place. | |
| channel | Yes | The saved selection to modify. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | No | ||
| fraction | No | ||
| selected_pixels | No |