add_effect
Add a non-destructive effect to a layer, or re-edit one in place with filter_id: one of vignette, black_white, motion_blur, lens_blur, add_noise, drop_shadow, outline, outer_glow, surface_blur. It is the same live, editable, maskable mechanism as add_adjustment, on the SAME filter stack: manage_filters (op=list, set_visibility, delete) manages both. type picks the effect; a field that belongs to another effect is refused, naming this type's own fields. An effect applies to ONE layer (layer_id or layer, else the selected or top layer), not to the flattened photo. A re-edit MERGES: any field you omit keeps its value. A filter that came with the file cannot be re-edited and is refused (delete it and re-create it). mask (a saved selection channel name) confines a NEW effect; it is fixed at creation and cannot change on a re-edit. ORDER MATTERS: straighten, flip and resize first, then crop, THEN add masked effects: rotate, flip and resize all refuse once a masked filter exists, or any filter that came with the file. vignette, motion_blur and drop_shadow stay locked to the content through flip, resize and an exact 90/180/270-degree rotation (their center, angle and offset fields update automatically, and manage_filters op=list shows the new values); rotating by any OTHER angle is refused while a vignette, a motion_blur or a drop_shadow with a non-zero offset is present, rather than letting it drift out of alignment. outline, outer_glow, surface_blur, lens_blur and a zero-offset drop_shadow have no direction, so they survive any rotation. A vignette that takes a corner to pure black is reported in the result (vignette_black_corners): where it reaches black it leaves a hard ring short of the corner. Resizing scales their pixel sizes with the photo (never below the 1 px minimum of outline width, outer_glow radius and surface_blur radius). lens_blur is a uniform soft-focus blur, not a depth-of-field falloff. outline puts a solid stroke around a layer's transparent edge (meme text, sticker cut-outs), width 1 to 50 px; outer_glow adds a soft glow around it (glowing text), spread 0 to 50 px; surface_blur smooths skin and other texture while keeping hard edges. outline and outer_glow need a layer with transparency, and attach to a text layer without rasterizing it: the text stays editable and the effect follows each edit. For a plain blur use add_adjustment type=gaussian_blur. Check the stack afterward with manage_filters (op=list).
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>",
"type": "<type>"
},
"name": "add_effect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | Name of a saved selection channel, confining a NEW filter to it. Only valid when creating (no filter_id) — a filter's mask is fixed at creation. ORDER MATTERS: straighten / flip / resize the canvas first (transform_image, resize), then crop, THEN add masked effects — rotate, flip, and resize all refuse outright once any masked filter exists on the image, or any filter not made with these tools, since they cannot keep a mask aligned through those transforms. Cropping afterward is always safe. | |
| name | No | Label for a new filter, e.g. "Corner darken". Made unique automatically. | |
| seed | No | add_noise only. RNG seed — the same seed reproduces the identical noise pattern (useful for an exact re-edit round trip). Default (when creating): 0. | |
| type | Yes | Which effect to create/re-edit — see the per-field descriptions below for which fields apply to which effect. | |
| alpha | No | add_noise only. Noise added to the alpha channel too. Default (when creating): 0. | |
| angle | No | motion_blur only. Direction of the streak, in degrees: 0 is horizontal, positive angles rotate clockwise (90 is vertical). Default (when creating): 0. | |
| color | No | outline and outer_glow only. "#rrggbb" hex. Default (when creating): "#000000" for outline, "#ffffff" for outer_glow. | |
| gamma | No | vignette only. Falloff curve shape: lower spreads the darkening further in toward the centre and deepens it; higher confines it to the corners and weakens it. Default (when creating): 2.0. | |
| image | Yes | Image id, as returned by open_photo. | |
| layer | No | Layer name. Defaults to the selected layer, or the topmost layer if none is selected. The filter applies to that ONE layer, not to the flattened image, so on a multi-layer document name the layer you mean. A layer inside a layer group can be named directly. | |
| width | No | outline only. Stroke thickness in pixels at full resolution, 1..50. Default (when creating): 4. SPATIAL. The stroke grows outward from the layer's alpha edge (round corners) and the layer's own pixels are untouched. | |
| length | No | motion_blur only. Blur length in pixels at full resolution, 0..1000. Default (when creating): 10. SPATIAL (scaled on the proxy preview, see overview). | |
| radius | No | vignette: size of the untouched centre, 0..3, relative to the LAYER (not absolute pixels — the same value looks visually equivalent at any resolution, and consistent with center_x/center_y below). SMALLER is STRONGER. Default (when creating): 2.0, a subtle vignette (corners about a quarter darker, centre untouched). At the default softness and gamma, 1.5 is strong (corners more than half darker) and 1.2 or less turns the corners black. A lower gamma blackens them sooner: measured on 4:5 and square frames, radius 1.4 at gamma 1.6 and radius 1.6 at gamma 1.5 both reach pure black before the corner, and where the darkening reaches black it shows as a hard edge (a ring) on any frame shape. For a falloff with no edge, keep the corners above black. lens_blur: blur radius in pixels at full resolution, 0..150 (default 25 when creating) — capped much lower than the other two effects here (measured live: expensive at full resolution). drop_shadow: blur radius in pixels at full resolution, 0..1500 (default 10 when creating), clipped to the layer bounds rather than growing it. outer_glow: glow blur in pixels, 1..250 (default 20 when creating). surface_blur: smoothing radius in pixels, 1..6 (default 4 when creating) — capped low because its cost grows with the square of the radius (a 24 MP export takes ~17 s at 6). lens_blur, drop_shadow, outer_glow and surface_blur are SPATIAL (radius-scaled on the proxy preview, see overview). The precise range is enforced for whichever `type` you gave. | |
| spread | No | outer_glow only. Pixels the glow's solid core grows past the alpha edge before it blurs, 0..50. Default (when creating): 4. SPATIAL. | |
| opacity | No | drop_shadow: default (when creating) 0.5. The shadow color is black and not configurable yet. outer_glow: default 0.75 (its color is the `color` field). | |
| center_x | No | vignette only. Vignette center, as a fraction of the LAYER's own width (not the whole canvas — 0 = left edge, 1 = right edge). Default (when creating): 0.5. Cropping re-centres the vignette on the new, smaller frame (the same fraction now means a different point) — the intended behaviour, like a post-crop vignette in Lightroom, not something to correct for. | |
| center_y | No | vignette only. Vignette center, as a fraction of the LAYER's own height (not the whole canvas — 0 = top edge, 1 = bottom edge). Default (when creating): 0.5. The vignette color is black and not configurable yet. | |
| 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. | |
| offset_x | No | drop_shadow only. Horizontal shadow offset in pixels at full resolution. Default (when creating): 20. SPATIAL (scaled on the proxy preview, see overview). Only meaningful on a layer with an alpha channel — a shadow is cast from what is transparent around the opaque content. | |
| offset_y | No | drop_shadow only. Vertical shadow offset in pixels at full resolution. Default (when creating): 20. SPATIAL (scaled on the proxy preview, see overview). | |
| softness | No | vignette only. How gradual the falloff is; 0 is a hard edge. Default (when creating): 1.0. | |
| filter_id | No | Re-edit this existing filter IN PLACE instead of adding a new one (must match `type`'s operation). Any per-effect field you omit keeps the value it already had — this is a MERGE, not a reset. The values manage_filters op=list reports for it are in these same field names and units, so they can be passed straight back. The mask is fixed at creation and cannot change on a re-edit. Only filters made with these tools can be re-edited (manage_filters op=list shows source: "editmamei"); re-editing any other filter (for example one added outside Connect) is refused, because its current values cannot be read back exactly — delete it and re-create it instead. A re-edit keeps the filter on its own layer; `layer` and `layer_id` are ignored. | |
| red_weight | No | black_white only. How much the red channel contributes to the resulting gray. Default (when creating): 0.333. | |
| blue_weight | No | black_white only. Default (when creating): 0.333. | |
| green_weight | No | black_white only. Default (when creating): 0.333. | |
| noise_amount | No | add_noise only. THE amount control — sets red/green/blue uniformly (grayscale-leaning noise, not a color-tinted one). Default (when creating): 0.02, a fine film grain; 0.04 is already a heavy, visible grain on a photo. | |
| highlight_factor | No | lens_blur only. Boosts bright out-of-focus highlights (bokeh) above this threshold. Default (when creating): 0 (no boost). lens_blur applies uniformly across the whole layer (a soft-focus effect), not a depth-of-field falloff — mask it (see `mask`) to confine it to part of the image instead. | |
| edge_preservation | No | surface_blur only. How much edge contrast survives, 0..1: LOWER smooths harder (near 0 starts to soften the edges too), HIGHER leaves more detail and noise. Default (when creating): 0.08, which flattens fine noise and skin texture while keeping hard edges sharp. | |
| preserve_luminosity | No | black_white only. Default (when creating): false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | ||
| name | No | ||
| note | No | vignette only: what to change when a corner went to pure black. | |
| type | No | ||
| filter_id | No | ||
| mindset_notes | No | ||
| vignette_black_corners | No | vignette only: the corners the photo now shows in pure black (empty when checked and none are). |