Seamless cloning
Blend a region by solving for pixel values that fit selected image gradients and boundary conditions.
The highlighted region is the part to reconstruct.
Choose the source gradients and a destination boundary.
Solve a Poisson-style reconstruction inside the mask.
Boundary values constrain the solve while source gradients shape the interior. This illustrates the blend, not a Poisson solution.
Combine the solved region with the destination image.
Illustrative example. The stages explain the method; they are not a live OpenCV execution.
Try it on an image
Experiment at pixel level
Clone the rectangle from the second image into the centre of the input. The Poisson solve blends gradients across the mask boundary.
The engine loads on your first run. Your images stay in this browser.
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
Select a pixel
Select a pixel
When to use it
Insert a patch with smoother boundary appearance or edit illumination inside a selected region.
How it works
- 01Choose the source gradients and a destination boundary.
- 02Solve a Poisson-style reconstruction inside the mask.
- 03Combine the solved region with the destination image.
match interior gradients while respecting boundary values
What to tune
The mask and centre define placement; NORMAL_CLONE and MIXED_CLONE choose different gradient sources.
Where it breaks down
The solution can shift colours to match the destination boundary. It does not guarantee physically consistent lighting or semantics.
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.
Related methods
Non-local means denoising
Average pixels whose surrounding patches look similar, even when they are not immediate neighbours.
Image inpainting
Fill a masked region by propagating nearby image structure and colour into it.
HDR merging and tone mapping
Combine exposure information or fuse well-exposed regions, then map the result into a displayable range.
Panorama stitching
Combine overlapping images through matching, camera estimation, warping and blending.