Repairing images with Resynthesizer and G'MIC

Slashdot it! Delicious Share on Facebook Tweet! Digg!

First Steps

Once installed, the tool appears in Filters | Enhance | Heal selection , as well as under Filters | Map | Resynthesize . The tool is very easy to access thanks to multiple menu entries.

To remove areas from an image, make a selection and then call Heal selection . Depending on the distribution and installation, you see one of the two dialogs in Figure 4. The parameters are largely self-explanatory. If you see the second version of the dialog, you can experiment with Filling order , which refers to the order of filling, and Sample from , which you use to define the origin of the material.

Figure 4: Heal selection has two versions of the dialog with different parameters. Both dialogs are found in the Enhance menu.

If you are not getting the results you want, you can do two things: either recall the function with Ctrl+F and check to see what has changed or change the selection. Sometimes it helps to move the selection somewhat or modify its size to achieve better results.

The Heal selection filter can also restore corners of images that are often be lost when "stitching" a panorama together. It occurs because information is missing in the relevant areas. Figure 5 illustrates the problem. The panorama does not have individual images that can provide information about the corners. Even so, Resynthesizer can compute these relatively well.

Figure 5: The Resynthesizer filter makes it possible to create parts of images that originally had no information.

G'MIC Inpaint

You can also use G'MIC plugins [5] to tackle problems associated with the removal of image areas. However, the corresponding filters are still not well documented.

Because G'MIC is pre-compiled, you can install it in a jiffy. The software comes in two versions: a standalone program that runs on the command line, even without Gimp, and a Gimp plugin, which you save to the plugin directory, as you did the Resynthesizer tool. Numerous distributions also offer suitable packages with names like gmic for the standalone program and gimp-gmic for the plugin version.

Ubuntu users can install the plugin with:

sudo apt install gimp-gmic

"Inpainting" is largely a restoration procedure that seamlessly covers selected areas with other areas [6]. In certain respects, the methods applied are similar to those of the Resysnthesizer tool. However, in practice, the use and the results are different for each tool. G'MIC currently offers no fewer than five versions of the procedure under Filters | G'MIC | Repair :

  1. Inpaint [holes] closes transparent areas.
  2. Inpaint [morphological] uses a mask to designate the area.
  3. Inpaint [patch-base]> uses small stitches for the procedure.
  4. Inpaint [multi-scale] combines procedures 2 and 3.
  5. Inpaint [transport-diffusion] , the most recent version, diffuses material in the masked region.

Each of these methods has distinct advantages and disadvantages. The example shown in Figure 6 illustrates the performance capability of Inpaint [holes] . This filter closes the gap in the checkered flower completely after a few repetitions. The result is so good that the outcome is very difficult to distinguish from the original.

Figure 6: The result achieved with Inpaint [holes] looks almost as good as the original in spite of the complex image structure.

At times, you need to get creative. In this example, the filter was applied experimentally with default settings. It did not completely cover the hole. The newly created layer was blended into the original layer via Layer | Merge Down and the layer was used again. Increased values for Tolerance and Maximal area then closed the rest of the hole.

Another method that has barely been documented but that achieves surprisingly good results (Figure 7) uses Inpaint [patch-based] . This method works directly on the image to be restored and lets you mark the areas that need editing with color (Mask color ). The filter replaces the marked areas immediately with small insert pieces from the environment that the plugin selects in such a way that the structure is maintained.

Figure 7: G'MIC's patch-based inpainting works with masks and achieves surprisingly good results with complex textures.

Buy this article as PDF

Express-Checkout as PDF

Pages: 5

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Adding new functions with GIMP plugins

    GIMP by itself can already do a lot. With plugins, you can extend the free image editor with complex functions, most of which allow you to see the final results before you apply them.

  • Pulling objects out of an image

    Extracting objects from an image is one of the most important techniques for image editing that exists. Gimp offers an entire series of these tools to help you do this.

  • Video effects and compositing with Natron

    Elaborate video compositing, blue screen tricks, and other complex video effects normally only appear in high-priced programs like Adobe After Effects, Nuke, or Fusion. Natron is open source, free, and gives high-priced alternatives a run for their money.

  • Designing Celtic knots with Knotter

    Would you like to adorn your letterhead with an attractive Celtic knot? Drawing one by hand is a laborious task, but Knotter provides a variety of functions to get the job done in a matter of minutes.

  • Processing and editing images in Lab mode

    Photivo closes the gap between RAW converters and easy image editing, thus making often required reworking in other programs unnecessary.