inpainting
Inpainting is a generative technique that fills in missing, damaged, or masked regions of images with plausible content that seamlessly blends with surrounding pixels, maintaining visual coherence in texture, structure, color, and semantic meaning. Originally developed for image restoration (removing scratches from old photos, filling in damaged areas), inpainting has expanded to creative applications including object removal, content editing, and image manipulation. Inpainting approaches have evolved through several generations: traditional methods (patch-based texture synthesis — PatchMatch algorithm copies and blends patches from known regions to fill unknown areas), CNN-based methods (partial convolutions and gated convolutions that handle irregular masks by masking invalid pixels during computation), GAN-based methods (adversarial training producing sharp, realistic fills — DeepFill v1/v2 using contextual attention to reference distant regions), and diffusion-based methods (current state-of-the-art — using denoising diffusion models conditioned on the masked image, achieving superior quality and coherence). Text-guided inpainting allows users to specify what should fill the masked region using natural language prompts — for example, masking a person's shirt and prompting "red sweater" to replace it. Stable Diffusion's inpainting pipeline and DALL-E 2's editing capabilities exemplify this approach. Key challenges include: structural coherence (maintaining lines, edges, and architectural elements across the mask boundary), semantic understanding (generating contextually appropriate content — filling a masked face region with a plausible face), large-area inpainting (filling very large missing regions where context is limited), temporal consistency for video inpainting (maintaining coherent fills across frames), and boundary artifacts (ensuring seamless blending at mask edges without visible transitions). Applications span photo restoration, object removal, privacy protection, image editing, texture completion, and medical imaging artifact removal.