inpainting
Inpainting is an image editing process where artificial intelligence fills or replaces a selected part of an image with new content that fits the surroundings.
In plain terms
Imagine a restorer filling in a chipped spot on an old painting: they look at the surrounding colors and brushstrokes and paint in the gap so that it cannot be noticed. Inpainting does the same on digital images, but in seconds, and instead of a restorer, an image generation model does the work.
It is used for two things. One is removal: you take the tourist who wandered into the shot, the power line or the stain out of the image, and a plausible background takes its place. The other is replacement or addition: you select an area, describe in text what you want there (for example, "red sofa" or "cloudy sky"), and the model paints it in.
It differs from full image generation in that most of the image remains untouched, with only the selected part changing. It is like a very smart eraser and brush combined: you do not get a new image, but you correct the existing one.
How it works
- You select the area to modify: paint over it with a brush, or let the tool automatically recognize the object. This selection is called a mask.
- If you want to change or add something, you specify in text what should go there. If you only want to remove something, the description can be omitted.
- The model examines the mask's surroundings: colors, lights, shadows, perspective, and patterns.
- It redraws the selected area so that the content fits the remaining parts of the image and your request. The most widespread diffusion models today do this step by step starting from noise, but other methods also exist.
- The new detail blends with the original at the edges. If you dislike the result, you can request a new version, as each run produces slightly different output.
An everyday example
On your vacation photo, a stranger stands in the background on the beach. In your phone's gallery, you circle them, press the delete button, and sand and waves appear in their place, as if they were never there.
Who is affected
A common misconception
Limits and risks
- The filled-in part is fabricated content, so it cannot be used as a document, evidence, or authentic press photo.
- It often makes mistakes with complex details (hands, text, reflections, repeating patterns), and the spot where it was corrected may remain visible up close.
- Rewriting other people's photos, for example changing clothing, faces or locations, can infringe personality rights and is open to abuse.
- Removing a watermark or authorship mark from an image may be illegal, even if technically simple.
Similar, but not the same
- outpainting (image expansion) – Outpainting extends the image beyond its edges, while inpainting fills in or replaces an internal part of the image.
- text-to-image generation – There, the full image is generated from scratch based on a description, while in inpainting only the selected part of an existing image changes.
- deepfake – A deepfake is an image, audio, or video created or modified with artificial intelligence that deceptively presents a real person, location, or event as authentic. Inpainting, by contrast, is a general image editing technique: it is used for many harmless purposes, but deepfakes can also be created with it.
Related concepts
generative AI, image generation, image editing
generative fill, object removal, video inpainting
outpainting, diffusion model, maszk, deepfake, watermarking
A brief history
The word originates from painting restoration, where it denotes the filling of damaged or missing parts. In digital image processing, it was made famous by Marcelo Bertalmío and co-authors in their 2000 study titled "Image Inpainting." The generative version controlled by text instructions spread in the early 2020s with diffusion models.
Where things stand
By the end of 2026, it will be a basic function of phone gallery apps, photo editing programs, and image generation services. It works increasingly on videos too, and in many devices it is already accessible with plain text requests, without selection. In such cases, however, the model may reconstruct the entire image, so the rest of the image may also change slightly.
Also known as
inpainting · image inpainting · generative fill · generative fill · image inpainting · AI inpainting · magic eraser · object removal
Sources
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.