Repairing images with Resynthesizer and G'MIC

Slashdot it! Delicious Share on Facebook Tweet! Digg!
photka, 123RF

photka, 123RF

First Aid

If you want to remove areas from a motif inconspicuously, then plugins like Resynthesizer and G'MIC can help by providing the right tools.

Frequently an image that otherwise looks good has a small flaw. The flaw can be dust on the lens, a car that drives unexpectedly into the frame, or a traffic sign that is inconveniently located. Inconspicuous removal of areas in images is one of the most frequent issues that arise. A good result depends on knowing the right tricks, having suitable plugins, and not needing to rely so heavily on the more archaic Eraser tool.

Because these problems occur often, you have an entire palette of options for removing troublesome areas as inconspicuously and seamlessly as possible. Gimp offers a series of tools, and special plugins expand these capabilities. The G'MIC plugin collection contains filters for editing out these types of problems.

The basic solution always involves the same approach: The editor responds by trying more or less to cover the problem part of the image automatically to create the impression of a homogeneous area. The simplest way to do this is with a Clone tool. Gimp has three of these, and they all work pretty much alike.

It is a good idea to observe the procedure one time in detail, because it serves as the basis for all additional procedures I describe here. In the future, the process will change fundamentally. Light field cameras [1], for instance, can provide data sets that make it possible to replace unwanted areas completely.

Problems When Cloning

Figure 1 shows the problems that come with cloning. To the left is the original image. To the right is the result after cloning. You should first select a source area by clicking while pressing the Ctrl key; then, use the Clone tool like a standard paint tool and edit the selected area.

Figure 1: Cloning an area of an image to cover a different area of the same image is not a good solution for all situations.

Although a very soft brush point was used in the example, the result does not look realistic for several reasons: The material suitable for cloning is very limited in scope, and the tool point is so large that it covers the middle of the area to be corrected.

The possibility of working with a small point does exist, but this would require a level of precision usually only possessed by experienced users. The application of color has to match the current pattern exactly. With the tool parameter Alignment: None , Gimp uses the same starting position for removing the colors and often makes the work easier.

The second problem is unfortunately more of an issue. The structure of the checkered flower is a real challenge to repair because even a small mistake can create clearly visible artifacts on the edges. The argument could be made that this is a special case that arises only infrequently and therefore does not necessarily call for a filter. However, in reality, these kinds of problems occur fairly frequently. The fur on the donkey in Figure 2 likewise has a regular structure, as do things like fields and ripples on waves in nature. In all of these motifs, a small mistake stands out like a sore thumb.

Figure 2: Small mistakes can be repaired manually in structured environments so that they are barely detectable. However this kind of repair can take a lot of work.

To edit out the barbed wire in Figure 2, you would not ordinarily use the standard Clone tool. Instead, the better choice would be the so-called Heal tool. It is very similar to the Clone tool, but it takes the value for the brightness of the environment into account when applying color.

As a rule, this gives better results with fewer visible aberrations. This rule holds as long as two conditions are fulfilled: You should choose a soft brush point that is larger than the area to be corrected, and you should move the tool with small, short motions or clicking or daubing strokes.

Removing brightness at the edges of the area that is to be corrected works better when the image contains a greater number of gradients of brightness. If you are working with RAW images, these corrections are already easier in the RAW converter.

Resynthesizer

Gimp has extensions for almost every area of application you can think of. These extensions come primarily in the form of scripts and plugins. Resynthesizer is an incredibly powerful add-on that is used in cloning. In his dissertation, the developer of Resynthesizer Paul Harrison describes it as a "texture synthesis" algorithm [2]. Additional information on this and similar procedures is found at Logarithmic.net [3].

In Ubuntu you can install it with

sudo apt install gimp-plugin-registry

Many other distributions offer the Resynthesizer plugin as a package in their repositories. Often these packages already contain scripts that make the expanded functions accessible. Alternatively, you can download the almost 70KB tarball from Resynthesizer at the Gimp Plugin Registry [4]. You unpack the compiled program, copy it either to the ~/.gimp-2.8/plug-ins/ or /usr/lib/gimp/2.0/plug-ins/ directory, and then you restart the graphics program.

Resynthesizer comes as a binary plugin and it displays some astounding properties. It lets you remove a selection (Filters | Enhance | Heal selection ) and also repair transparent areas (Filters | Enhance | Heal transparency ).

When you choose Filters | Enhance | Uncrop , the plugin enlarges images and fills in the transparent edges. Additionally, you can create larger textures out of small pieces. With Filters | Map | Style you can transfer the style applied in one image to another. Filters | Enhance | Enlarge & sharpen makes it possible to enlarge and sharpen an image simultaneously.

Figure 3 shows the plugin options, which you can bring up by selecting Filters | Map | Resynthesize . It provides access to all functions and is therefore complex.

Figure 3: The Resynthesizer interface offers every function; as a result, it ends up being complex.

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.