Programming Gimp Plugins with Python

In this article we look at a simple Hello World of a Gimp plugin in Python. For editing I can recommend the development environment PyCharm. This can be downloaded from

Copy the following source code into a new file and save it as

#!/usr/bin/env python import gtk from gimpfu import * def helloWorldFn() : # Using gtk to display an info type message see -> message = gtk.MessageDialog(type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_OK) message.set_markup("Hello World \nThis Dialog Will Cause Unexpected Issues During Batch Procedures") message.destroy() # Using GIMP's interal procedure database see -> pdb.gimp_message("Hello World, This Message Looks Like An Error And/Or Warning") # Using stdout see -> print "Hello World \nThis message does not show in the GUI." # (Unix Terminal Output) Will not work on Windows Based Systems. return # see -> register( #name "helloWorldPlugin", #blurb "Saying Hello World", #help "Saying Hello to the World", #author "William Crandell <>", #copyright "William Crandell <>", #date "2015", #menupath "Hello World", #imagetypes (use * for all, leave blank for none) "", #params [], #results [], #function (to call) helloWorldFn, #this can be included this way or the menu value can be directly prepended to the menupath menu = "<Toolbox>/Hello/") main()

For a Gimp plugin, you must first import gimpfu. Then define the function that contains the code of the plugin. This is followed by a call to the register function. This registers the plugin, the parameters are mostly self-explanatory, more information can be found at At last the main function is called, which starts the plugin. This Hello World uses three different methods to output a simple message. A MessageBox with gtk, a Gimp function that prints a message at the bottom of the Gimp program and with stdout an output to the console.

Now start Gimp and go to Edit > Preferences > Folders Click on the plus icon to the right of Folder and go to Plugins. Here you can see the folders where you need to copy the plugin.

Screenshot 1

Copy the into one of the specified folders and restart Gimp. The plugin is now available in the menu bar.

Screenshot 2

You are welcome to upload your programmed plugins to our website.