Apps Part of Lumina

Spot Healing & Clone Stamp

Remove dust spots and blemishes with seamless healing or a clone stamp.

Each stroke: {"mode":"heal"|"clone","points":[[x,y],…],"radius":0.03,"hardness":0.5,"opacity":1,"source":[dx,dy]}. x, y, dx and dy are fractions of width and height (0.5 = middle); radius is a fraction of the longer side (0.002–0.15). Heal strokes may omit "source". Up to 200 strokes, 400 points each, 8000 in total.

Try an example: ·

More about this tool

How it works

Upload a photo and a list of brush strokes. Heal strokes replace a spot with texture from a nearby area and blend it seamlessly into the surrounding colour and brightness (Poisson-style seamless cloning); clone strokes copy pixels exactly from a source area. Leave out the source of a heal stroke and the tool picks the best-matching nearby area. Download a PNG plus the resolved strokes as JSON for the Lumina photo editor, where they stay editable.

  • Auto-oriented, display-referred 8-bit sRGB. Points and source offsets are fractions of the width and height; the radius is a fraction of the longer side, so the same strokes fit any size of the photo.
  • Strokes run in order; each one sees the result of the previous strokes. Heal without a source picks one automatically.
  • Brush mask: distance from each pixel centre to the stroke path; fully on up to radius × hardness, then a smoothstep fall-off to zero at the radius. Source pixels are sampled bilinearly (clamped to the photo edge) at the stroke position plus the offset.
  • Clone blends the source pixels in with mask × opacity. Heal solves the Poisson equation of seamless cloning (Pérez, Gangnet & Blake 2003) as a membrane: result = source + c, where c is harmonic inside the stroke and equals target − source just outside it. The 5-point Laplace system is solved per colour channel with conjugate gradients from a coarse-grid starting value (relative residual 10⁻⁴, at most 400 iterations).
  • Automatic source: 48 candidate offsets (16 directions × 2.2, 3 and 4 stroke radii) inside the photo; the one whose surroundings best match the ring just outside the stroke (mean squared RGB difference) wins, first candidate on ties.
  • Healing cannot invent content that exists nowhere in the photo: large objects on busy backgrounds need a hand-picked source or several smaller strokes. No AI or content-aware fill.

Sources

Part of Lumina

  • Lumina Photo editor & image toolkit

    Bring out what you saw. A free photo studio, right in your browser.

    Open Lumina

How to use Spot Healing & Clone Stamp

Remove dust spots, blemishes and small distractions from a photo with seamless healing or an exact clone stamp, and get the strokes back as JSON.

What it is for

Dust on a sensor or scanner glass leaves dark specks in bright skies; blemishes or litter distract in the same way. This tool removes them from an uploaded PNG, JPEG or WebP (up to 8 MB and 16 MP) with a list of brush strokes.

A heal stroke copies texture from a nearby area and then shifts it so that its colour and brightness match the edge of the spot. That is why healing a speck in a gradient sky leaves no lighter or darker disc. A clone stroke copies pixels exactly from the source area, which is better for hard edges and repeating patterns. Leave out the source of a heal stroke and the tool looks for the best-matching area around the spot itself.

It is not an AI fill: every pixel comes from the same photo. The same strokes stay editable in Lumina's Retouch panel.

Worked example

The first built-in example is a 160 × 120 sky gradient with four dark dust spots: three heal strokes without a source and one clone stroke that copies from 8 % further right. The tool answered:

Applied 4 retouch strokes to a 160 × 120 photo; 172 pixels changed.

Automatic sources shows 3. The returned strokes explain the choice: the first two spots take their texture from 13 pixels to the left (source offset −0.08125 of the width), the third from 12 pixels to the right.

For a bigger test, a 1000 × 668 JPEG of a lake with eight dark dust spots got eight heal strokes, each with a radius of 0.019 (19 pixels) and hardness 0.75:

Applied 8 retouch strokes to a 1000 × 668 photo; 7478 pixels changed.

All eight sources were automatic. Five came from 45 pixels straight to the left or right; three used diagonal neighbours, for example the spot next to the mountain ridge, which took its texture from the upper right where the ring around it matched the sky better. In the PNG the specks are gone and the sky shows no patches.

How to read the result

  • Download retouched PNG: same size as the upload, metadata removed.
  • Heal strokes / Clone strokes: how many of each were applied, in order.
  • Automatic sources: heal strokes for which the tool picked the source.
  • Changed pixels: pixels that differ from the upload.
  • Strokes table: radius and source offset in pixels for each stroke.
  • Download strokes (JSON for Lumina): the complete list, including the automatic sources. Paste it into the retouch field of a Lumina project to keep editing.

Tips and common mistakes

  • Make the radius a little larger than the spot, and use hardness 0.7–0.8 for round specks. A soft edge that still covers part of the spot leaves a faint ring.
  • Coordinates are fractions: x 0.5, y 0.5 is the middle. Because the radius is a fraction of the longer side, the same strokes fit a downscaled copy of the photo.
  • Strokes run in order, and each one sees the result of the previous ones. Heal a big blemish before cloning texture over its neighbour.
  • Clone strokes always need a source. A heal stroke without one fails with a clear message if no clean area of the same size fits next to it.
  • You can paste a whole .lumina.json project into the strokes field; the tool uses its retouch list.

FAQ

Does the tool upload my photo?

Yes. The tool runs on the usefulweb.site server and keeps the result for about two hours. Lumina's Retouch panel does the same work in your browser without uploading.

Why does healing look better than cloning on skies?

Healing matches the brightness at the edge of the spot, so a source from a slightly lighter part of the sky still blends in. Cloning copies it as it is.

Will the editor give the same result?

Yes. Lumina and the tool share one engine: the same strokes on the same pixels give the same SHA-256, which the tool reports as sha256Rgba.

Can it remove a person from a crowded scene?

Not reliably. Use several smaller strokes or pick sources yourself; nothing new is invented.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://luminaspotheal.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://luminaspotheal.usefulweb.app/mcp · tool name lumina_spot_heal
Example request
curl -s -X POST https://luminaspotheal.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{…see OpenAPI examples…}'
Feedback · ideas & bug reports welcome