# Local Photo Adjustments with Masks (Gradient, Radial, Brush, Range) > Brighten, darken or recolor parts of a photo with gradient, radial, brush and range masks. 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. Part of usefulweb.app (https://usefulweb.app/). Part of [Lumina](https://lumina.usefulweb.app/) (ownerApp: lumina). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://luminalocaladjust.usefulweb.app/ (interactive tool at https://luminalocaladjust.usefulweb.app/tool) - JSON API: POST https://luminalocaladjust.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://luminalocaladjust.usefulweb.app/api/v1/tool) - OpenAPI: https://luminalocaladjust.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://luminalocaladjust.usefulweb.app/mcp - tool `lumina_local_adjust` ## Inputs - image (file, required): Image (PNG, JPEG or WebP; up to 8 MB and 16 MP) - adjustments (textarea, required): Local adjustments (JSON list, an object with "local", or a Lumina project) - Settings: exposure −3 to 3, the others −100 to 100. Masks: linear (start, end), radial (center, radiusX, radiusY, angle, feather), brush (strokes with size, feather, flow, erase, points), luminance (min, max, feather) and color (color, tolerance, feather); mode add, subtract or intersect; invert. - output (select): Download - maskOf (number): Adjustment number for the mask download ## Method - 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.