Adding new functions with GIMP plugins

Slashdot it! Delicious Share on Facebook Tweet! Digg!
ccvision

ccvision

Extensions

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.

GIMP developers don't integrate many complex functions into GIMP itself; rather, these elements are stored in external plugins. Thus, the GIMP code base can remain lean. Additionally, there's always the chance that not even core team programmers use the plugin interface to add enhancements. For simple extensions, the scripts written in Script-Fu often suffice, but they don't provide preview capabilities and are limited in their execution speed.

Script-Fu also provides a challenge even to experienced programmers with its Scheme dialect as a Lisp variant. Plugins, on the other hand, can be written in C, C++, Python, Lua, Ruby, Perl, and other languages. As binaries, they are nonetheless bound to specific GIMP or operating system versions and need to be updated along with them.

Moreover, some of the plugins may lack some fine-tuning so they might crash from time to time – especially with larger images. When this happens, an error message will identify the problem, and the crash usually will not affect GIMP's stability, even though the error message may suggest otherwise. If you want to create your own plugin, GIMP developers provide a three-part How-To page [1], although they still have some catching up to do with new GEGL developments.

GIMP looks for plugins in the home directory under ~/.gimp-2.8/plug-ins/ and in the system directory under /usr/lib/gimp/2.0/plug-ins/ . For GIMP to be able to run the extensions, you need to set the execution privileges to chmod +x ~/.gimp-2.8/plug-ins/* . The system-installed plugins using the package manager already have the proper privileges.

The Plug-in Browser (Figure 1) from the Help menu provides information about all available plugins and tells you where the extension is located, with <Image> representing the image window.

Figure 1: The plugin browser displays all the current plugins with their versions and a short description.

Installing Plugins

Developers deliver many plugins as source code so they can easily be integrated into many platforms. Unless the documentation tells you otherwise, you should install gimptool-2.0 along with GIMP to enable the plugins (see the "Tip" box for more information).

Tip

Because compiling and libraries are easy to handle in Linux, plugins can be quickly created, but they cannot be created as easily in Windows. If you need to use GIMP in Windows, the GIMP Extensions Pack for Windows [2] can help with many fully compiled plugins.

To install the C source plugins, proceed as follows. First, install the required libraries and tools for the build process using

$ sudo apt-get install build-essential libgimp-devel

at the command line.

Next, compile the plugin with the following command (although some developers prefer using the three-way command ./configure && make && make install instead).

$ gimptool-2.0  --install plug-in.c

Using --build instead of --install builds the plugin without installing it. Using --install-admin installs the plugin system-wide in /usr/lib/gimp/2.0/plug-ins/ (requires superuser privileges). Other compiler and linker options include --cflags , --libs , and --prefix=<prefix> or --exec-prefix=<prefix> . The --uninstall-bin <plug-in> or --uninstall-script <script> options uninstall a plugin or corresponding script.

Popular Plugins

Some plugins are especially popular among GIMP users because they provide especially useful functions. One of the most important and powerful plugins is G'MIC [3]. The scope of functionalities of this tool is so immense that the article in the GIMP Handbook (January, 2014) can only begin to scratch its surface. G'MIC not only includes many different functions for editing images but also implements new layer modes not included in the GIMP kernel. G'MIC is itself an interpreter for its own scripting language for image editing.

To manipulate RAW images, GIMP usually defers to UFRaw [4]. Some of the other specialized file formats, such as the OpenRaster format used for MyPaint, can be integrated through plugins [5]. Even the WebP format promoted by Google has its corresponding plugin [6].

Considered almost indispensable is the Layer Effects [7] plugin that provides classic effects such as inner and outer shadows and halos for transparency layers. Although usually developed for text layers, the Layer Effects performs create great visual effects on other layers as well. The plugin is available for Script-Fu or, preferably Python, because it works faster and has a preview feature.

Of equal importance is the GIMP Animation Package (GAP) [8] [9] that was developed for editing videos and creating larger animations. This is a comprehensive package that requires a bit of training to use. You might be better off for small animations with the Advanced Animation with GIMP [10] package.

Buy this article as PDF

Express-Checkout as PDF
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