Local Photo Adjustments with Masks (Gradient, Radial, Brush, Range)
Brighten, darken or recolor parts of a photo with gradient, radial, brush and range masks.
How it works
Upload a photo and describe up to eight local adjustments as JSON: each has exposure, contrast, highlights, shadows, temperature, tint, saturation, clarity and sharpness and is limited by up to eight masks (linear gradient, radial gradient, brush strokes, luminance range or color range) that add, subtract or intersect. Download the adjusted PNG or the grayscale mask of one adjustment. The Lumina photo editor stores the same JSON in its projects.
- Display-referred 8-bit sRGB after auto-orientation. Positions are fractions of the uploaded image (0–1, top-left origin); radii and brush sizes are fractions of its shorter side, so circles stay circles.
- Each adjustment computes its fully adjusted version of the current result, then blends it in per pixel by mask coverage × amount. Adjustments run in list order; luminance and color ranges are measured on the uploaded image, before any local adjustment. Alpha is kept.
- Linear: t = projection of the pixel centre onto start → end (0 at the start, 1 at the end), clamped and smoothed with smoothstep 3t² − 2t³. Radial: elliptical distance d (1 on the edge); full inside 1 − feather, smoothstep to 0 at the edge. Brush: strokes are capsules around the polyline rasterized on a grid of 1024 cells along the long side, feathered with smoothstep and composited with flow (erase multiplies by 1 − flow × coverage); sampled bilinearly.
- Luminance: Rec. 709 luma of the encoded values in percent; full inside min to max, smoothstep falloff over the feather width. Color: OKLab distance × 100 to the chosen color; full up to the tolerance, smoothstep falloff over feather percent of the tolerance.
- Combination: the first mask starts the coverage; add = maximum, subtract = coverage × (1 − mask), intersect = coverage × mask; invert uses 1 − mask first.
- Settings reuse the Lumina Develop formula (exposure as 2^EV, contrast, highlight and shadow tone curve, temperature and tint offsets, saturation). Clarity adds the midtone-weighted difference between luma and a two-pass box blur of 1 percent of the shorter side; positive sharpness is the 3 × 3 edge-aware sharpen of Develop, negative sharpness blends toward a 3 × 3 box blur.
Sources
Part of Lumina
-
Lumina Photo editor & image toolkit
Bring out what you saw. A free photo studio, right in your browser.
How to use Local Photo Adjustments with Masks
Brighten, darken or recolor only part of a photo with gradient, radial, brush, luminance and color masks, and read the coverage report.
What it is for
Global sliders change every pixel, but a bright sky wants less exposure and a face in shadow wants more. This tool applies such local adjustments to an uploaded PNG, JPEG or WebP and returns a PNG.
You describe up to eight adjustments as JSON. Each one has exposure, contrast, highlights, shadows, temperature, tint, saturation, clarity and sharpness, plus up to eight masks that decide where it applies: a linear gradient, a radial gradient, brush strokes, a luminance range or a color range. Masks add, subtract or intersect, and each can be inverted. Lumina stores the same JSON in its photo projects, where you can draw the masks with handles and a brush.
It is not subject detection or AI masking: you place the masks yourself, and the edits are display-referred 8-bit sRGB, not RAW development.
Worked example
The first example uses a 160 × 120 synthetic landscape: a sky gradient, a pale sun and dark hills. Two adjustments are given. "Darker sky" sets exposure −0.8, highlights −40 and saturation 20 with a linear gradient from start [0.5, 0.62] (no effect) to end [0.5, 0.1] (full effect). "Warm sun" has amount 80, temperature 40 and exposure 0.3 with a radial mask at [0.7, 0.28], radius 0.25 and feather 80.
The summary says "160 × 120 photo adjusted with 2 of 2 local adjustments." The coverage table lists "Darker sky" with 36 % average coverage and 6,880 pixels at 50 % or more, and "Warm sun" with 5.77 % and 1,020 pixels. In the PNG, a pixel at the top of the sky changes from about RGB 164, 200, 234 to 70, 95, 118, while a hill pixel at the bottom keeps 36, 54, 31 because the gradient has not started there.
How to read the result
- Download adjusted PNG is the result at the input size; alpha is kept. With Download set to the mask option you get a grayscale PNG instead: white is full coverage of the chosen adjustment, black none.
- Coverage of each adjustment: the number of masks, whether the adjustment changes pixels at all, the average coverage in percent and how many pixels are covered at least halfway. An adjustment with all settings at 0, amount 0 or no mask shows "no".
- Download adjustments (JSON for Lumina) returns the validated list with every default filled in. Open it in Lumina with Open photo to add the adjustments to the photo there.
Tips and common mistakes
- Positions are fractions of the image: [0, 0] is the top-left corner, [1, 1] the bottom-right. Radii and brush sizes are fractions of the shorter side, so a radius of 0.25 on a 160 × 120 image is 30 pixels in both directions.
- The first mask starts the selection; its mode is ignored. Put the broad mask first and refine it with subtract or intersect masks.
- Luminance and color ranges are measured on the uploaded image, before any local adjustment, so the order of adjustments does not shift those selections.
- A color tolerance of 5 to 15 picks one hue family; feather 100 doubles the reach with a soft falloff.
- A brush stroke is a soft capsule around the line through its points, so long strokes need only a few points.
FAQ
Can I just send a Lumina project?
Yes. The adjustments field accepts a list, an object with a "local" list, or a whole Lumina photo project; only its local adjustments are used. Crop, rotation and Develop settings of the project are ignored.
Why does an adjustment with a mask change nothing?
It needs at least one setting other than 0, an amount above 0 and enabled set to true. The coverage table shows "no" in that case.
What does subtract do exactly?
The coverage so far is multiplied by one minus the new mask, so a fully covered pixel of the new mask is removed completely and a half-covered one is halved. Add takes the larger value; intersect multiplies.
Is the photo stored?
The upload is processed on the server and the PNG is kept as a temporary download for about two hours. Inside the Lumina editor the same adjustments run on your device.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://luminalocaladjust.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://luminalocaladjust.usefulweb.app/mcp· tool namelumina_local_adjust
Example request
curl -s -X POST https://luminalocaladjust.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'