add-mask
Adds a mask layer on top of the stack with optional adjustments, as one edit, and returns its layerId. Coordinates are source pixels, unaffected by crop. A linear mask covers fully at start and fades out at end; a…
mask, adjustments: object?
delete-layer
Removes a layer and the layers inside it.
layerId: string
get-stateread-only
Describes the open photo: its file, source size in pixels, crop frame, layers from bottom to top with their IDs and settings, and undo history. Color mixer arrays list red, orange, yellow, green, aqua, blue, purple…
open-image
Opens the image at url in place of the open photo, with a new undo history, and describes it like get-state. The page fetches url, so another origin must allow CORS. To open a local file, such as an image attached to…
url: string
redo
Redoes the last undone edit.
reset
Removes every layer and returns the photo's adjustments, tone curve, white balance, crop, and perspective to how it opened, as one edit.
run-commands
Runs several commands in order in one call. Each command is an object with the name of another tool as its type, such as set-adjustments or add-mask, and that tool's fields. Each is its own undo step. Returns each…
commands: array
set-adjustments
Sets basic adjustments, keeping the ones omitted. Exposure is in stops from -5 to 5; the others go from -100 to 100, where 0 is neutral. Without layerId they tone the whole photo; with a mask's layerId they apply…
exposure: number?, incrementalTemperature: number?, incrementalTint: number?, contrast: number?, highlights: number?, shadows: number?, whites: number?, blacks: number?, … (list cut; the site may define more)
set-color-mixer
Shifts one color range's hue, saturation, or luminance from -100 to 100, keeping other colors and omitted values. Neutral grays are unaffected. Without layerId it edits the first Color Mixer layer, creating one when…
hue: number?, saturation: number?, luminance: number?, color: string, layerId: string?
set-crop
Replaces the crop, rotation, and flips with the largest centered crop of the photo, keeping its perspective correction. aspectRatio is width / height and defaults to the photo's; straighten rotates by -45 to 45…
aspectRatio: number?, straighten: number?
set-details
Sets clarity (local contrast, -100 to 100), sharpening (0 to 150), and sharpenRadius (0.5 to 3 pixels), keeping omitted values. Without layerId it edits the first Details layer, creating one when there is none.
clarity: number?, sharpening: number?, sharpenRadius: number?, layerId: string?
set-grain
Adds film grain: amount from 0 (off) to 100, size from 0 (fine) to 100 (coarse), and roughness from 0 (even) to 100 (clumped), keeping omitted values. Without layerId it edits the first Grain layer, creating one when…
amount: number?, size: number?, roughness: number?, layerId: string?
set-preview
Shows the edited photo, the original, or a split comparison of both, without editing the photo.
comparison: string
set-tone-curve
Replaces the tone curve: points map input x to output y, from shadows at x 0 to highlights at x 1, ordered by x. Omit points to reset it. Without layerId it tones the whole photo after its adjustments; with a mask's…
points: array?, layerId: string?
set-vignette
Darkens the photo's edges: intensity from 0 (off) to 100 and softness from 0 to 100, keeping omitted values. Without layerId it edits the first Vignette layer, creating one when there is none.
intensity: number?, softness: number?, layerId: string?
set-white-balance
Sets a RAW photo's white balance: temperature in Kelvin from 2000 to 25000 and tint from -150 to 150. Other photos have no white balance; warm or cool them with set-adjustments' incrementalTemperature and…
temperature: number?, tint: number?
undo
Undoes the last edit.