Masking exactly the object outline and leaving its shadow behind, which is what makes a removal look faked.
AI and on-device processing
Inpainting
Also called image inpainting, content-aware fill or object removal fill. Here is what it means, when it changes what you export, and what people get wrong.
The short answer
Inpainting fills a selected region of a photo with content that matches its surroundings, so whatever was there looks as though it never existed. You paint a mask over the unwanted area and the algorithm reconstructs it from nearby texture, structure, or a learned sense of what usually belongs there.
Updated
The short version
Inpainting at a glance
| Quick fact | Detail |
|---|---|
| Inputs | An image plus a mask of the region to fill |
| Patch-based approach | Copies real texture from elsewhere in the photo |
| Generative approach | Predicts new pixels from a trained model |
| Easiest surfaces | Sky, grass, sand, plain walls, carpet |
| Hardest cases | Straight lines, repeating patterns, text, faces |
| Mask advice | Include shadows, reflections and a small margin |
Slide the table sideways to see every column.
How does a tool decide what to put in the hole?
There are three broad families, and most editors use more than one.
- Diffusion-style interpolation spreads colour and gradient inwards from the edge of the mask. Excellent for scratches, dust and single-pixel lines, useless for anything larger.
- Patch-based synthesis searches the rest of the photo for regions that fit the hole, then stitches the best matches in. It reuses real pixels from your image, so texture stays believable, but it can only copy what already exists in frame.
- Learned generative fill predicts the missing pixels from a model trained on many images. It can invent structure that appears nowhere else in your photo, which is both the strength and the risk.
Why should you mask past the edge of the object?
Objects leave traces beyond their outline. A bottle on a table has a contact shadow, a soft cast shadow, a reflection in the surface, and a halo of bounced colour on nearby items. Mask only the bottle and every one of those survives, so the fill produces a clean patch of table with a bottle-shaped shadow still lying across it.
Mask generously. Include the shadow, the reflection and a few pixels of clean surroundings. The extra area costs you almost nothing, because the surroundings are easy to reconstruct, while a missed shadow is the single most common reason a removal looks wrong.
When does inpainting give itself away?
Reconstruction is easiest where the surroundings are statistically boring and hardest where a human eye already knows the answer. Grass, sand, sky, plaster and carpet fill almost invisibly. The reliable failure cases are:
- Straight lines and edges that must continue through the hole, such as skirting boards, tiles and window frames
- Regular patterns, where a half-pitch offset in the repeat is instantly visible
- Text and logos, which get rebuilt as convincing nonsense
- Faces and hands, where small errors read as uncanny rather than as noise
- Large masks over the middle of a subject, where there is little context to work from
What people get wrong about inpainting
Each one is a real failure mode, not a style preference.
Filling one huge region in a single pass when two or three smaller, well-placed masks would each have more context to work from.
Inpainting a compressed export rather than the original file, so the fill has to imitate JPEG artefacts as well as texture.
Using inpainting to remove a watermark from an image you have no licence to use, which fixes the pixels and not the permission.
Questions people ask
Inpainting, answered
The follow-up questions people search for once they have the definition.
Why does the filled area look blurry compared with the rest of the photo?
Most fills are produced at a lower working resolution and scaled back up, and some methods average several plausible answers, which softens detail. Filling a smaller region at full resolution usually sharpens the result, and adding a touch of matching grain helps it blend.
Can I remove a person from a group photo?
Usually yes if they are at the edge and standing against a simple background. It gets much harder when they overlap another person, because the tool has to invent the hidden body, or when they cast a shadow across someone else. Mask both the person and the shadow.
Is inpainting the same as content-aware fill?
Content-aware fill is a product name for one kind of inpainting, historically the patch-based kind that borrows texture from elsewhere in the same image. Inpainting is the general term and covers everything from single-pixel scratch repair to full generative reconstruction.
How do I fix a fill that came out wrong?
Change the mask before changing the settings. Nine times out of ten the problem is a mask that clipped the object, missed its shadow, or swallowed a structural line the fill then had to guess at. Redraw, run again, and only then adjust anything else.
Same cluster
More from the glossary
Neighbouring entries, so every term in the set is one hop from every other.
Interpolation
Interpolation is how software works out pixel values at positions that did not exist before, which is what happens whenever you resize, rotate or warp an image.
JFIF
JFIF (JPEG File Interchange Format) is the standard wrapper that makes a JPEG readable by other programs.
Image noise
Image noise is the random speckle in a photo that does not correspond to anything in the scene.
From the studio
Tools that do this
Each one runs on your own device, so the photo stays where it is.
Keep reading
Elsewhere on Photomop
Platform image rules
Image size, file type and background rules for 22 selling platforms, each one sourced.
Read itConvert image
JPG, PNG, WebP and AVIF, with an honest answer about HEIC and alpha.
Read itAll the tools
The whole toolbox in three families, with what each one needs before it can run.
Read itOn-device privacy
The pipeline in five steps, what leaves your device, and how to check it yourself.
Read it
Now do it to a photo
Photomop is a photo studio that runs on your own device. Resize, crop, compress, convert, batch edit, remove a background and change one all work in the browser tab you are reading this in, at full resolution and with no watermark. The on-device page shows you how to check that the photo stays put.