Inpainting

Inpainting is filling in a missing, damaged or deliberately masked part of an image so the result looks whole; AI inpainting generates new content for the selected area that fits its surroundings.

The word comes from art conservation, where restorers fill in damaged or missing parts of a painting so the work can be seen whole. In 18th-century Venice, Pietro Edwards directed the restoration of paintings with a scientific approach centred on the artist's intentions, and the modern approach took shape at a conference in 1930.

Inpainting moved into digital media from the mid-1990s. A 2000 SIGGRAPH paper by Marcelo Bertalmío, Guillermo Sapiro, Vicent Caselles and Coloma Ballester, titled Image Inpainting, filled gaps by carrying information inward from the edges of the hole. Later exemplar-based methods searched the rest of the image for similar patches and copied the best match into the gap, which handled texture better. These methods work well for small holes in regular backgrounds but cannot invent an object that is not suggested anywhere in the picture.

Generative models removed that limit. Because a diffusion model has learned what scenes generally look like, it can generate plausible new content for a masked area, guided by the surrounding pixels and, optionally, a text prompt. The December 2021 latent diffusion paper behind Stable Diffusion reported state-of-the-art inpainting results. In May 2023 Adobe brought the approach to Photoshop as Generative Fill, which uses its Firefly models to add, extend or remove content described in a prompt, placing the result on a separate layer.

In everyday use the steps are simple: select or paint over the area to change, optionally describe what should go there, and let the model fill it. Common jobs include removing a passer-by, cleaning scratches and dust from old film, removing logos from video and repairing lost blocks in streaming video. Outpainting is the same idea applied beyond the image's original borders.

One point is easy to miss. Inpainting does not recover what was really behind an object; it invents something that fits. That is fine for a holiday photo, but it matters when images are used as evidence or in news, which is one reason tools such as Generative Fill attach content credentials recording that AI was used.

Common questions

What is inpainting in AI?

AI inpainting fills a selected region of an image with newly generated content that matches its surroundings. You mark the area, optionally describe what you want there, and a generative model, usually a diffusion model, creates the fill.

What is the difference between inpainting and outpainting?

Inpainting fills in or replaces an area inside the image. Outpainting extends the image beyond its original edges, generating new content around it. Both use the same kind of generative model.

Does inpainting reveal what was hidden behind an object?

No. The model has no information about what was really there, so it generates something plausible based on the surroundings and what it learned in training. The result can look convincing but is invented, which matters if the image is used as evidence.

Finding more

Search for "image inpainting", "diffusion inpainting", "exemplar-based inpainting" or "generative fill" to learn more. Original papers on arXiv and in graphics conference proceedings explain the methods, and software makers' documentation covers the tools. For the conservation meaning, museum and conservation bodies are the most reliable sources.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.