add_adjustment
Add a non-destructive adjustment to a layer, or re-edit one in place with filter_id. It stays live and editable; nothing is baked into pixels until export_photo, and manage_filters op=delete removes it again. type picks the adjustment: curves, levels, exposure, brightness_contrast, hue_saturation, color_balance, color_temperature, shadows_highlights, saturation, vibrance, sharpen, noise_reduction, gaussian_blur. A field that belongs to another type is refused, naming this type's own fields. An adjustment applies to ONE layer (layer_id or layer, else the selected or top layer), not to the flattened photo: on a multi-layer photo, say which layer. For vibrance the knob is the vibrance field (saturation on that type is a separate plain multiplier that normally stays untouched). curves: ONE filter per channel, so add separate filters for red and blue rather than one for both; points are [input, output] pairs on a 0-255 scale, including the endpoints. hue_saturation and color_balance likewise carry ONE range per filter. A large hue shift (more than about 30) on a range that is mostly low-saturation pixels, such as a grey sky, posterizes into blotches and hard bands: shift those colors with color_balance or a small hue move instead. gaussian_blur: radius in pixels at full resolution; combine it with a saved-selection mask for soft-focus or background-blur effects. color_temperature runs the opposite way to what you might expect: raising to_kelvin WARMS the photo. A re-edit MERGES: any field you omit keeps its value, so re-editing {contrast: 50} on a brightness_contrast filter doesn't reset brightness. 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 adjustment; it is fixed at creation and cannot change on a re-edit. ORDER MATTERS: straighten, flip and resize first, then crop, THEN add masked adjustments: rotate, flip and resize all refuse once a masked adjustment exists, or any filter that came with the file. 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_adjustment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hue | No | hue_saturation only. Degrees. Default (when creating): 0. | |
| 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 adjustments — rotate, flip, and resize all refuse outright once any masked adjustment 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. "Lift shadows". Made unique automatically. | |
| type | Yes | Which adjustment to apply/re-edit. Each type maps to exactly one operation; see the per-field descriptions below for which fields apply to which type. | |
| gamma | No | levels only. Midtone gamma, 0.1..10 — >1 brightens midtones, <1 darkens. Default (when creating): 1.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. | |
| range | No | hue_saturation: one of all/red/yellow/green/cyan/blue/magenta (default 'all'). color_balance: one of shadows/midtones/highlights (default 'midtones'). ONE range per filter: adjusting reds and blues, or shadows and highlights, takes one filter per range (the same rule as one curves filter per channel). Passing a value from the other type's set is rejected, naming the real allowed set for the `type` you gave. | |
| scale | No | saturation only. 1.0 = unchanged. Default (when creating): 1.0. | |
| amount | No | sharpen only. Unsharp-mask strength MULTIPLIER, not a percent: 0.5 is the default, 1.0 is strong, and values above ~3 are extreme. Default (when creating): 0.5. | |
| in_low | No | levels only. Input black point; must stay below in_high (an empty or inverted input range is refused). Default (when creating): 0. | |
| points | No | curves only. [input, output] pairs, 0-255 each, ascending input — include the endpoints, e.g. [[0,0],[64,90],[255,255]] lifts shadows. Required when creating (no filter_id); omitted on a re-edit keeps the existing curve. | |
| radius | No | shadows_highlights: spatial falloff radius, 0.1..1500 (default 100 when creating). sharpen: unsharp-mask std-dev, 0..1500 (default 3.0 when creating). gaussian_blur: blur radius (std-dev) in pixels at full resolution, 0..1500 (default 1.5 when creating). All three are SPATIAL (radius-scaled on the proxy preview, see overview). | |
| channel | No | curves/levels only. 'value' adjusts all channels together (tone); red/green/blue adjusts ONE channel (color) — a filter carries only one channel, so shifting color needs separate filters for red and blue. Default (when creating): value. Omitted on a re-edit keeps the existing filter's own channel. | |
| in_high | No | levels only. Input white point; must stay above in_low. Default (when creating): 255. | |
| out_low | No | levels only. Output black. Default (when creating): 0. | |
| shadows | No | shadows_highlights only. Default (when creating): 0. | |
| compress | No | shadows_highlights only. How far the shadows/highlights effect reaches toward the midtones: higher confines it to the darkest and brightest tones. Default (when creating): 50. | |
| contrast | No | brightness_contrast only. Default (when creating): 0. | |
| cyan_red | No | color_balance only. Default (when creating): 0. | |
| exposure | No | exposure only. Stops. Default (when creating): 0. | |
| 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. | |
| out_high | No | levels only. Output white. Default (when creating): 255. | |
| strength | No | noise_reduction only. Neighbourhood size. Default (when creating): 4. | |
| vibrance | No | vibrance only. THE vibrance control — a vibrance adjustment must set this field, not `saturation` (a separate, plain multiplier for this type that normally stays at its default). The scale follows Photoshop's Vibrance: +10 to +30 is a natural boost, +50 a strong one; negative values desaturate. Unlike Photoshop's, it lifts already-saturated colors (a blue sky, a bright shirt) about as much as muted ones, so check those areas with a histogram above about +50. Default (when creating): 0. | |
| filter_id | No | Re-edit this existing filter IN PLACE instead of adding a new one (must match `type`'s operation). Any per-type 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. | |
| lightness | No | hue_saturation only. Default (when creating): 0. | |
| threshold | No | sharpen only. Default (when creating): 0. | |
| to_kelvin | No | color_temperature only. The corrected target temperature. COUNTER-INTUITIVE DIRECTION: RAISING to_kelvin WARMS the image (it means "render as if shot under this light" — a higher assumed light temperature reads as a warmer correction). Example: from_kelvin 6500, to_kelvin 8000 renders WARMER, not cooler. Default (when creating): 6500. | |
| brightness | No | brightness_contrast only. Default (when creating): 0. | |
| highlights | No | shadows_highlights only. Default (when creating): 0. | |
| saturation | No | hue_saturation: -100..100 percent (default 0 when creating), the field that actually adjusts saturation for that type. vibrance: a SEPARATE, plain saturation multiplier layered on top of the vibrance field below — 1.0 = unchanged (default when creating), 0..10 scale. It is NOT the vibrance knob; normally leave it alone and use `vibrance` instead. The precise range is enforced for whichever `type` you gave. | |
| whitepoint | No | shadows_highlights only. Shifts the white point: positive brightens the top end, negative pulls it down. Default (when creating): 0. | |
| black_level | No | exposure only. Shadow black-point shift. Default (when creating): 0.0. | |
| from_kelvin | No | color_temperature only. The temperature the photo currently looks shot under. Default (when creating): 6500. | |
| yellow_blue | No | color_balance only. Default (when creating): 0. | |
| magenta_green | No | color_balance only. Default (when creating): 0. | |
| shadows_ccorrect | No | shadows_highlights only. Colour saturation kept in the lifted shadows (0 = none, 100 = full). Default (when creating): 100. | |
| highlights_ccorrect | No | shadows_highlights only. Colour saturation kept in the recovered highlights (0 = none, 100 = full). Default (when creating): 50. | |
| preserve_luminosity | No | color_balance only. Default (when creating): true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | ||
| name | No | ||
| type | No | ||
| filter_id | No | ||
| mindset_notes | No |