Skip to content

Image inpainting

Algorithm atlasPhotography

Fill a masked region by propagating nearby image structure and colour into it.

Try it on your image ↓

VISUAL WALKTHROUGHPhotography
REFERENCE INPUTA masked strip in the image

The highlighted region is the part to reconstruct.

RESULTFill the missing strip

The smooth field illustrates continuation into a hole. Texture and larger missing structures are not recovered simply by extending a gradient.

STEP 03 / 03

Estimate missing values using the chosen Telea or Navier-Stokes method.

Illustrative example. The stages explain the method; they are not a live OpenCV execution.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Remove a rectangular region using surrounding pixels. The selected rectangle is the repair mask.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Remove small scratches or fill narrow missing regions when a plausible continuation is sufficient.

How it works

  1. 01Mark the pixels to replace.
  2. 02Advance inward from the known boundary.
  3. 03Estimate missing values using the chosen Telea or Navier-Stokes method.

known boundary → inward propagation → synthesized fill

What to tune

inpaintRadius controls the local neighbourhood; flags select the algorithm. Keep the mask distinct from observed-data coverage.

Where it breaks down

The result is synthesized. It is not evidence of the original hidden content, especially across large missing objects.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.