---
title: Image Inpainting
description: >-
  What image inpainting is, how masked regeneration replaces a selected region
  of an image, and how it is used in virtual try-on pipelines.
shortDefinition: Regenerating a masked region of an image while leaving the rest untouched.
relatedTerms:
  - diffusion-model
  - image-segmentation
  - garment-transfer
  - occlusion
heroImage: /glossary-images/image-inpainting-mask.webp
keywords:
  - image inpainting
  - masked image generation
publishedAt: '2026-06-10'
updatedAt: '2026-06-10'
noindex: false
canonicalPath: /glossary/image-inpainting
---

## What is image inpainting?

**Image inpainting** is a computer vision technique that reconstructs or replaces a selected region of an image while keeping the rest untouched. Originally used to restore damaged photographs and remove objects, it is now commonly performed by [diffusion models](/glossary/diffusion-model.md), which fill the masked region with new, context-aware content.

In virtual try-on, inpainting confines generation to the clothing region: the face, hair, and background of the original photo are preserved pixel-for-pixel, and only the garment area is regenerated.

![Inpainting: original photo, masked clothing region, regenerated result](/glossary-images/image-inpainting-mask.webp)

## How it works in a try-on pipeline

1. **Mask creation**: [image segmentation](/glossary/image-segmentation.md) produces a pixel-precise mask of the garment to replace.
2. **Context encoding**: the model analyzes everything outside the mask: skin tone, lighting direction, background.
3. **Conditioned regeneration**: the masked area is filled with the new garment, guided by the product image and the person's pose.
4. **Blending**: mask edges are feathered so the regenerated region transitions smoothly into the preserved pixels.

## Main challenges

- **Mask accuracy**: a mask that misses a sleeve leaves the old garment visible; one that is too large erodes hands or hair.
- **[Occlusion](/glossary/occlusion.md)**: hair or crossed arms in front of the clothing must remain in the foreground.
- **Boundary realism**: visible seams between generated and original pixels break the illusion, especially at collars and hems.

<Faq>
  <FaqItem question="Is inpainting the same as content-aware fill?">
    Same idea, different capability. Content-aware fill copies surrounding textures to hide an object; generative inpainting synthesizes new, semantically correct content, such as a garment that was not in the photo.
  </FaqItem>
</Faq>
