This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Inpaint

Inpaint
retouches parts of image that correspond to nonzero elements in region.
  • Inpaint works with arbitrary grayscale and multichannel images.
  • The region to be retouched can be given as an image, a graphics object, or a matrix.
  • Inpaint always gives an image of the same dimensions and the same type as image.
  • Inpaint operates separately on each color channel.
  • Inpaint takes a Method option that specifies the inpainting method to be used. By default the method is used.
  • Possible settings are:
"Diffusion"iterative isotropic diffusion method
"TotalVariation"iterative total variation method
"FastMarching"fast marching method
"NavierStokes"Navier-Stokes method
"TextureSynthesis"best-fit texture synthesis method using random sampling
  • Inpaint operates separately on each color channel, except with the setting Method.
  • With Method, the following suboptions can be specified:
"NoiseModel""Gaussian", , or
"Regularization"Automaticregularization parameter
  • With Method, the following suboptions can be specified:
"NeighborCount"30number of nearby pixels used for texture comparison
"MaxSamples"300maximum number of samples used to find the best-fit texture
  • Inpaint takes a MaxIterations option that specifies the maximum number of iterations to be performed using the iterative methods. The default setting is MaxIterations.
Retouch a crack in a photograph:
Retouch a crack in a photograph:
In[1]:=
Click for copyable input
Out[1]=
Inpaint large objects:
Restore corrupted parts of an image:
Use more samples to achieve a better texture synthesis:
The method usually gives a better reconstruction of sharp edges:
Use inpainting to remove a timestamp:
Use inpainting to remove salt-and-pepper noise:
Inpainting can remove large objects from an image:
Inpaint the image borders created by a geometrical transformation:
Texture synthesis:
New in 8