AI Glossary / Computer vision and multimodal AI / Intermediate

PDE / diffusion inpainting (Bertalmío)

Definition

PDE-based inpainting fills a selected missing or damaged image region using equations that propagate information from its surroundings. The influential method associated with Bertalmío and colleagues continues image structure into the gap using partial differential equations, with smoothing as part of the process.

What it means

A partial differential equation, or PDE, describes how a quantity changes across space and sometimes an artificial evolution time. In inpainting, that quantity can be image intensity. The surrounding pixels provide clues about what should continue through a masked area. The method is especially intuitive for narrow scratches and small gaps crossed by smooth structures. It does not retrieve the original hidden pixels. Also, the label diffusion inpainting is broader than the specific Bertalmío method: simple smoothing, anisotropic diffusion and structure-propagating equations are related ideas but are not interchangeable algorithms. Here diffusion means mathematical propagation, not a modern generative diffusion model.

How it works

A user or another system supplies a mask identifying pixels to replace. Information at the boundary guides iterative updates inside the mask. In the classic Bertalmío approach, a smoothness-related quantity is transported along isophote directions: directions following curves of equal image intensity. This encourages visible structures to continue through the missing area, alongside a diffusion step that helps maintain a usable evolving image.
A numerical solver approximates the equations on the pixel grid. Initialization, discretization, boundary handling and iteration settings affect the result. Large missing areas and rich textures are difficult because local smoothness and contour continuation provide limited evidence about distant or highly detailed content.

Three practical examples

  • A restoration demonstration fills a thin scratch crossing a smoothly shaded background.
  • A scanned graphic has a small damaged region repaired by extending nearby lines and tones.
  • An image-processing course compares local PDE inpainting with patch-based completion on smooth regions and textured fabric.

Think of it this way

Think of extending the visible edges of a pencil drawing across a small tear, using the directions on either side as guides. This conveys structural continuation. The analogy stops at the missing evidence: neither the mathematical method nor the person can know with certainty what was originally in a large unseen region. A convincing continuation is still a reconstruction.

Worked example

Consider a simplified one-dimensional gap with known endpoint intensities 20 and 80 and two unknown pixels between them. A basic harmonic interpolation example gives equal increments: 20, 40, 60, 80. Each unknown value equals the average of its neighbors: 40 = (20 + 60)/2 and 60 = (40 + 80)/2.
This calculation illustrates a smoothness-based filling principle, not the complete Bertalmío algorithm. In a two-dimensional image containing an edge, indiscriminate averaging can blur the edge. Structure-aware PDE methods use additional directional information to encourage an appropriate continuation. If the hidden region originally contained a small object, smooth interpolation would not recover it from these endpoints alone.

Illustrative case study

In a fictional digitization workshop, an editor compares methods for repairing scratches on a scanned poster. A PDE-based tool gives a plausible continuation across a narrow mark in the plain margin, but smears a wider damaged area containing decorative texture. The editor retains the original scan, records the edited mask and chooses a different restoration approach for the textured area. The example demonstrates matching a method to the available visual evidence. It does not suggest that the reconstructed pixels are an authentic recovery of the damaged artwork.

Common misconceptions and mistakes

The method is not the same as generative diffusion inpainting, despite the shared word diffusion. It does not necessarily copy texture patches from elsewhere in the image. The classic structure-transport method is also more specific than simply applying a blur inside a hole. Another mistake is evaluating only whether the edit is hard to notice. In documentation or measurement, preserving the distinction between observed and reconstructed content may matter more than visual seamlessness. A mask that accidentally includes intact detail can replace information that never needed repair.

Business use

For image editing and restoration workflows, compare methods using the actual gap sizes and image types expected in production. Inspect edge continuity, color transitions and loss of texture. Keep originals and edit masks so changes can be revisited. If the images support analysis, separate repaired display copies from source measurements. PDE methods can offer a useful, interpretable baseline, but their suitability should follow from the task rather than the historical importance of the algorithm.

People also ask

Does PDE inpainting require a training dataset?

Classical PDE methods generally operate from equations and the supplied image rather than a learned dataset.

Is it best for large missing objects?

Local structure propagation often struggles with large holes and complex textures; suitability depends on the scene and method.

Does a smooth result prove accuracy?

No. Smoothness indicates a property of the reconstruction, not proof that it matches the missing original content.

Check your understanding

A smooth interpolation fills a scratch successfully but turns a missing patterned region into a flat patch. Why can the same method behave differently?

Answer: Smooth surroundings provide useful local continuation clues. Detailed texture needs information that smoothness alone does not supply.

Related terms

  • Inpainting
  • Isophote
  • Image gradient
  • partial differential equation
  • diffusion
  • Laplacian
  • harmonic interpolation
  • exemplar-based inpainting
  • generative diffusion model

Learn next

Learn image gradients and isophotes next, then compare simple harmonic filling with directional structure propagation. Test both on a narrow scratch and a large textured hole, keeping the masks and original images available for comparison.

More in Computer vision and multimodal AI

  • Parallel projection - Parallel projection maps three-dimensional points onto a two-dimensional plane along parallel projection lines.
  • Path finding - Path finding is the process of finding a sequence of valid connections from a starting state to a destination.
  • Pattern grammar - A pattern grammar is a set of rules describing how simpler components can combine into structured patterns.
  • Peak signal-to-noise ratio (PSNR) - Peak signal-to-noise ratio, or PSNR, is a logarithmic measure comparing the allowed peak signal range with the mean squared error between a test image and a...
  • Perception - distortion tradeoff - The perception - distortion tradeoff describes a tension in image reconstruction between matching an individual reference image according to a distortion...
  • Phase-based magnification - Phase-based magnification is a video-processing technique that makes small motions more visible by modifying temporal changes in the local phase of image...

Sources

Bertalmío, Sapiro, Caselles and Ballester, Image Inpainting, institutional publication record: https://collaborate.princeton.edu/en/publications/image-inpainting/ Author-associated institutional repository record: https://www.colibri.udelar.edu.uy/items/793cc617-5111-4807-8c9d-922558155f74 Primary publication record and search excerpts consulted; full algorithmic source and editorial review remain pending.

Previous: PDE-constrained optimization Next: Peak signal-to-noise ratio (PSNR)

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer