Adding new functions with GIMP plugins

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Batch Converter

GIMP is designed to work on individual images. If you want to work on many images with the same tools and settings, two plugins are available: DBP (David's Batch Processor) [16] and BIMP (Batch Image Manipulation Plugin) [17]. Both plugins provide an extensive array of preset tools that work on images in sequence based on the same settings. You can find DBP (Figure 9) in the Filter menu under Batch Processing… . You can choose from a small selection of standard tools, such as for rotating, scaling, and sharpening images.

Figure 9: DBP is simple and clear but without many features.

BIMP goes a step further (Figure 10). Apart from the usual tools, the plugin allows you to use your favorite GIMP functions and apply them to the loaded images, with the desired parameters set in advance. (See the "Installing BIMP" box for installation details.)

Figure 10: BIMP provides more manipulation opportunities than DBP. Especially interesting is the ability to use a freely selected function.

Installing BIMP

You won't find BIMP in every repository. Fortunately, installation is really easy. First, unpack the archive, in the directory of your choice, for example $HOME/Downloads/BIMP , and run

$ make
$ make install

to install the plugin for your user. Or, you can do

$ make
$ sudo make install-admin

if you want to install the plugin system wide.

You can largely ignore warnings. You'll then find the plugin entry in the File menu under Batch Image Manipulation… .

RAW images are easily managed by GIMP with the UFRaw plugin. For large numbers of images, however, using UFRaw on each one is a cumbersome process, because each image must first be loaded manually with the desired settings made in advance. Thus, a special version of the program, ufraw-batch , is available on the command line to work on any number of RAW images automatically.

The ufraw-batch -h command gives you a summary of options. Some especially interesting ones include --exposure=auto for automatic exposure corrections and --black-point=auto for automatic determining of black points, which is often a good idea. The --wb=camera command uses the white balance of the particular camera, and --wb=auto determines it on its own. The best choice depends on the image.

The --base-curve= switch takes one of the following arguments: manual , linear , camera , custom , or the name of a previously loaded and defined curve. This setting controls the "base curve," that is, the basic recalculation of image brightness before other corrections occur. It needs to be defined only once per camera model. The following options determine the form of the output file: --shrink=<factor> sets a reduction factor, --size=<width x height> explicitly defines the size, and --out-type=<types> sets the output format (which is specified as ppm , tiff , tif , png , jpeg , jpg , or fits ).

Fourier and Wavelets

An important aspect of image processing is (mathematical) transformation known as Fourier transformation (Figure 11), without which many further procedures wouldn't be possible. You can apply Fourier transformation explicitly with the Fourier plugin [18]. The plugin provides two functions (under Filter | Generic ): Fourier Forward converts the current layer or selection into its Fourier representation, with which you can perform the desired editing. For example, you can introduce a copyright symbol that "survives" any scaling, rotating, or cropping. Fourier Inverse reverts to the visible RGB image that should hardly differ from the original.

Figure 11: The original image (upper half) and its Fourier representation (lower half).

Fourier analysis is interesting mainly for specialists, but the wavelet filters based on it are useful for all kinds of effects. Wavelets [19] are curves used for displaying and editing different-sized details in images. Three plugins are available that use this method.

The Wavelet Decompose [20] plugin, which you can find in the Filters | Generic menu, creates an image copy with (by default) seven layers (Figure 12). The "Original" layer contains the original image for comparison purposes. The "Wavelet Scale 1" through "5" layers contain the image details in five different sizes. "Wavelet Residual" sums up the remaining image details. You can edit each later separately with special effects, or you can save copies of individual layers in the stack. Note that the layers lie on top of one other in the "Grain merge" layer mode to present the image as a whole. The Wavelet Denoise plugin [21] was developed especially for denoising images (Figures 13 and 14).

Figure 12: Wavelet Decompose shows clearly how wavelets work and can be applied. The layers contain details of various sizes. You can modify each layer separately or remove them entirely.
Figure 13: Wavelet-based denoising is applied to separate channels and therefore usually renders good results without color fringing. The "softness" acts as a threshold and controls the denoised region.
Figure 14: Results of wavelet denoising are usually quite good because they're usually barely noticeable. Only with high magnification can you tell that the usual "snow" is missing (inside the highlighted region).

The denoising also implicitly affects sharpening of the image. Some images show that higher Threshold along with increased Softness can yield good results. This filter behaves quite differently from, for example, the unsharp mask . The marcor plugin is especially meant for sharpening with wavelets (Wavelet sharpen [22]).

The default settings for Sharpen luminance only (Figure 15) should typically be enabled because they prevent color aberrations. You can determine the "strength" and "radius" values based on the preview.

Figure 15: Pure wavelet sharpening also reduces noise. The results are even better with "denoise" applied beforehand.
Figure 16: The Refocuse plugin can lead to very different results based on parameter settings. Because of the processing needed, new previews have to be refreshed manually.

Buy this article as PDF

Express-Checkout as PDF
Price $0.99
(incl. VAT)

Buy Ubuntu User

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content