fill
Add a NEW layer, canvas-sized, filled with a solid colour (op solid), a linear gradient (start to end) or a radial gradient (centre and radius) through 2-8 colour stops. The layer goes directly above the target layer (inside its group), with the blend mode and opacity you give; mode color tints without touching lightness, the usual choice for recolouring. Pass mask (a channel name) to confine the fill to that channel: it becomes the layer mask. Gradients blend in sRGB, are not dithered, and use photo pixels for every point. The current selection is kept and does not clip the fill. Do NOT use for painting strokes or touching up pixels; use retouch for that. Returns layer_id, layer_name, op, mode, opacity and masked. On this server the new layer is canvas-sized, so it counts toward a photo's layers together staying within its layer limit, each counted at the canvas size (or the largest layer size used in the photo, if bigger).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | 'solid': one flat color. 'linear_gradient': a ramp from start to end. 'radial_gradient': a ramp from a center out to a radius. | |
| end | No | linear_gradient: where offset 1 sits, in image pixels. Default bottom center of the canvas. | |
| mask | No | The name of a selection channel: becomes the new layer's layer mask, white where the channel is selected, so the fill shows only there. | |
| mode | No | The new layer's blend mode. 'color' keeps the lightness underneath exactly and swaps only hue and chroma, the usual choice for recoloring. | normal |
| name | No | New layer's name. Default 'Fill' for solid, 'Gradient' for a gradient. | |
| color | No | solid only: the color as #rrggbb. | |
| image | Yes | Image id, as returned by open_photo. | |
| layer | No | Name of the layer the new fill layer goes directly above (inside its group). Defaults to the selected layer, or the topmost layer if none is selected. | |
| start | No | linear_gradient: where offset 0 sits, in image pixels. Default top center of the canvas. | |
| stops | No | Gradient only: 2-8 color stops {offset 0..1, color #rrggbb, opacity 0..100}, sorted by offset. Colors blend in sRGB (a black to white stop pair reads 128 at the midpoint). Before the first stop and after the last, the end colors hold. | |
| center | No | radial_gradient: where offset 0 sits, in image pixels. Default canvas center. | |
| radius | No | radial_gradient: the distance in pixels at which offset 1 is reached. Default half the canvas diagonal. | |
| opacity | No | The new layer's opacity, 0-100. | |
| layer_id | No | Layer id, as inspect (and any tool that creates a layer) reports it. Takes priority over `layer`, and is the only way to address one of two layers that share a name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | ||
| mode | No | ||
| masked | No | ||
| opacity | No | ||
| layer_id | No | ||
| layer_name | No |