Create layer
gimp_create_layerAdds a new raster layer with alpha to a GIMP image at a specified parent and position, using pixel dimensions, offsets, fill color, opacity, visibility, and layer mode in one undo step.
Instructions
Add a new raster layer (with alpha) to an image, at an explicit parent and position. Size and offset are in image pixels (default: the image size at 0,0). fill: 'transparent' or a color. 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": {
"image": "<image>",
"name": "<name>"
},
"name": "gimp_create_layer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| fill | No | sRGB color as '#rrggbb', '#rrggbbaa', '#rgb' or one of: white, black, red, green, blue, transparent | transparent |
| mode | No | GIMP layer mode nick, e.g. normal, multiply, screen, overlay, soft-light, hard-light, addition, subtract, difference, darken-only, lighten-only, hue, saturation, color, dodge, burn, pass-through (groups). Invalid names are refused with the list of allowed ones. | normal |
| name | Yes | ||
| image | Yes | Image id from gimp_status, e.g. 'image:1@a1b2c3d4'. | |
| width | No | ||
| height | No | ||
| parent | No | Group id to put the layer in; null for the top level of the image. | |
| opacity | No | 0 (transparent) - 100 (opaque). | |
| visible | No | ||
| position | No | Index within the parent, 0 = top-most (in front). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Offset of the layer's top-left corner in image pixels. | |
| y | Yes | ||
| id | Yes | ||
| kind | Yes | ||
| mask | Yes | ||
| mode | Yes | GIMP layer mode nick, e.g. 'normal', 'multiply'. | |
| name | Yes | Layer name. GIMP keeps names unique within an image ('Title #1'). | |
| locks | Yes | ||
| width | Yes | ||
| height | Yes | ||
| parent | Yes | Id of the parent group, null at the top level. | |
| opacity | Yes | 0-100. | |
| visible | Yes | ||
| children | No | Child layers of a group, top-most first; null for non-groups. | |
| has_alpha | Yes |