Try it free while you read:
✦ Open AI Object RemoverInpainting fills missing or unwanted parts of an image using information from the rest of the picture; classic methods diffuse colour inwards or copy matching patches; modern deep-learning methods learn what scenes usually look like; and every method ultimately makes an educated estimate, which is why selection size and background type matter so much for quality.
When you paint over a watermark and it disappears, it can feel like magic. It isn’t — it’s one of the most studied problems in image processing, called inpainting. Understanding the basics will help you get better results from any tool, including our free AI Object Remover and AI Watermark Remover.
What is inpainting?
Inpainting is the process of filling in missing or damaged parts of an image so that the result looks plausible and consistent. The term originally comes from art conservation, where restorers repaint damaged areas of paintings. In digital imaging, “missing” can mean anything you want to remove: a watermark, a scratch, a person, a wire, a block of text.
The tool is given two things: the image, and a mask — the area you painted. Its job is to replace every masked pixel with something that fits.
Approach 1: Diffusion-based inpainting
The earliest digital methods treated inpainting like heat spreading through metal. Colours from the edges of the hole “flow” inwards, smoothly, until the hole is filled. Mathematically, these methods solve equations that favour smooth transitions — the simplest version makes each missing pixel the average of its neighbours, repeated until nothing changes.
Strengths: perfect for smooth areas — sky, walls, skin, gradients. Very fast.
Weaknesses: can’t reproduce texture. On grass or brick, the result looks like a smooth smudge.
Our Smooth fill engine is a refined diffusion method. It first fills the hole layer by layer from the outside using distance-weighted averages, then relaxes the result until it’s seamless, and adds a hint of grain so it doesn’t look plastic.
Approach 2: Patch-based (exemplar) synthesis
In the early 2000s, researchers realised that natural images are full of repetition: grass looks like other grass, bricks repeat, waves resemble other waves. So instead of inventing colour, why not copy small patches from elsewhere in the image?
Patch-based methods work roughly like this:
- Find the pixels on the boundary of the hole.
- For a boundary pixel, look at the small square neighbourhood around it (a “patch”) — part known, part missing.
- Search the rest of the image for the patch that best matches the known part.
- Copy the missing part from that matching patch.
- Move inwards and repeat until the hole is filled.
The order matters: good algorithms fill areas along strong edges first, so that lines continue naturally through the hole. Clever search shortcuts — such as checking where neighbouring pixels found their matches and searching nearby (“coherence”) plus random samples — make it fast enough to run interactively.
Strengths: reproduces real texture convincingly.
Weaknesses: can produce repeated patterns or copy the wrong object if the image doesn’t contain suitable source material.
Our Smart texture engine is a patch-based method with coherence propagation and random search, applied in “onion-peel” order from the outside of the hole inwards, followed by a light blend at the seams.
Approach 3: Deep learning inpainting
Neural networks trained on millions of images learn what scenes generally look like: where horizons go, how faces are structured, what’s likely behind a parked car. Given a masked image, they predict the missing content directly. The newest generative models can even create entirely new objects in the hole based on a text prompt.
Strengths: can fill large holes with plausible structure, even when similar content doesn’t exist elsewhere in the image.
Weaknesses: large models need powerful hardware or cloud servers; results may “hallucinate” details that look convincing but never existed; quality can vary with image style.
Why your selection matters so much
All three approaches rely on information outside the mask. The bigger the mask, the more must be invented and the less certain the result. That’s why our guides keep recommending:
- Select tightly but completely — include halos and shadows, but don’t paint huge areas unnecessarily.
- Work in passes — each pass adds real-looking pixels around the remaining hole.
- Finish lines last — so the algorithm can continue them from both sides.
Why the background type matters
| Background | Best method | Why |
|---|---|---|
| Sky, walls, skin | Diffusion (Smooth fill) | No texture to copy; smoothness looks natural |
| Grass, sand, brick, water | Patch-based (Smart texture) | Texture repeats and can be copied |
| Unique objects (faces, signs) | Deep learning or manual | Content must be invented or carefully rebuilt |
On-device vs cloud inpainting
Large generative models usually run on cloud servers, which means uploading your image. Patch-based and diffusion methods are efficient enough to run in a browser, so your photo stays on your device. For most everyday removal jobs — watermarks, date stamps, wires, litter, photobombers on consistent backgrounds — classic methods produce excellent results privately and instantly.
Inpainting is always an estimate
No inpainting method can truly know what was behind an object. It produces a plausible reconstruction. That’s fine for holiday photos and product images, but it’s why edited images shouldn’t be presented as evidence or as unaltered documentation.
Putting it into practice
Next time you remove something, think like the algorithm: is there similar material nearby to copy from? If yes, Smart texture will shine. If the area is smooth, Smooth fill is your friend. If the hidden content is unique, keep the selection small and accept that some invention is inevitable.
Frequently asked questions
What is AI inpainting?
It’s a technique that fills selected parts of an image with content generated from the surrounding image, making objects or marks disappear.
Is content-aware fill the same as inpainting?
Yes — “content-aware fill” is a commercial name for inpainting technology, typically patch-based.
Why does inpainting sometimes repeat patterns?
Patch-based methods copy texture from nearby; occasionally the same source is reused. Remove one repeat again with a small brush.
Can inpainting recover what was really behind an object?
No. It creates a plausible estimate, not the true hidden content.
Does your tool upload images for inpainting?
No. Our inpainting engines run in your browser.
Put this guide into practice
Our AI Object Remover is free, private and works right in your browser.
✦ Try AI Object Remover


