Draw line / polyline
gimp_draw_pathDraws a solid polyline through pixel coordinates on a GIMP item, with configurable width, color, opacity, caps, joins, and optional closure; clips outside points and records one undo step.
Instructions
Stroke a polyline through points [[x, y], ...] (image pixels, at least 2 points) with a plain line of the given width, color and opacity; closed=true joins the last point to the first. Uses a solid line, never the user's brush. Points outside the layer are clipped. 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>",
"points": "<points>",
"color": "<color>"
},
"name": "gimp_draw_path"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | round | |
| item | Yes | Item id (layer, group, mask...) e.g. 'item:5@a1b2c3d4'. | |
| join | No | round | |
| color | Yes | sRGB color as '#rrggbb', '#rrggbbaa', '#rgb' or one of: white, black, red, green, blue, transparent | |
| width | No | Line width in pixels. | |
| closed | No | ||
| points | Yes | ||
| opacity | No | 0-100. | |
| antialias | No |
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. |