Draw rectangle / ellipse
gimp_draw_shapeDraw a rectangle or ellipse on a GIMP layer with fill and/or stroke colors, leaving the selection unchanged in a single undo step.
Instructions
Draw a rectangle or an ellipse (inscribed in x, y, width, height) on a layer, filled with fill_color and/or outlined with stroke_color (stroke centered on the outline). The image's selection is left unchanged. One undo step.
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": {
"item": "<item>",
"shape": "<shape>",
"x": "<x>",
"y": "<y>",
"width": "<width>",
"height": "<height>"
},
"name": "gimp_draw_shape"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| item | Yes | Item id (layer, group, mask...) e.g. 'item:5@a1b2c3d4'. | |
| shape | Yes | ||
| width | Yes | ||
| height | Yes | ||
| opacity | No | 0-100. | |
| antialias | No | ||
| fill_color | No | sRGB color as '#rrggbb', '#rrggbbaa', '#rgb' or one of: white, black, red, green, blue, transparent | |
| stroke_color | No | sRGB color as '#rrggbb', '#rrggbbaa', '#rgb' or one of: white, black, red, green, blue, transparent | |
| stroke_width | No | Line width in pixels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | ||
| changed | Yes | False when the painted area does not intersect the layer. | |
| affected | Yes | Image-space box of the pixels that may have changed. |