In this article, I present GIMP plug-ins basics and introduce the libgimp API. I will also show how to use the PDB to make our plug-in available to other script authors.
New developers are often intimidated by The GIMP size and its reputation. They think that writing a plug-in would be a difficult task. The goal of these articles is to dumb this feeling down, by showing how easily one can make a C plug-in.
In this part, I present a plug-in’s basic elements. We will see how to install a plug-in and how to get data from an image and directly manipulate it.
The GIMP script interface is centered on the Procedural database (PDB). At startup, The GIMP looks into a predefined set of places for scripts and plug-ins, and asks each new script to identify itself.
The plug-in declares itself to the PDB at that time, and passes informations like the position it wishes to get in the menu hierarchy, input parameters, and output parameters.
When a script or a plug-in wants to use our plug-in, it gets through the PDB, which manages communicating parameters in one direction and the other in a transparent way.
Internal functions that wish to get exposed to plug-ins have to be packaged first in the core, that will register them in the PDB, and secondly in the libgimp that will allow the function to be called as a normal one.
This was the introduction – now, we will look closer at our first plug-in, a “Hello, world!”.
Compiling the plug-in
To be able to compile simple plug-ins for The GIMP, one needs libgimp headers, as well as an associated utility named gimptool.
With that utility, one can install a plug-in either in a private directory (~/.gimp-2.0/plug-ins), or in the global plug-in directory.
gimptool-2.0 –install plugin.c or gimptool-2.0 –install-admin plugin.c
This utility, with other options, can also be used to install scripts, or uninstall plug-ins.
A GIMP plug-in can typically behave three different ways. It can take image data, modify it, and send back the modified image, like edge detection. It…
You can read the article in its entirety, on the official website of https://developer.gimp.org/writing-a-plug-in/1/index.html
Thanks a lot … I hope your thoughts, your geniuses can have as much resonance as possible.