Episode 130: Getting the Bugs out

130Download the Video! (61.2 MB, 32:10)
Download the Companion File! (767 Bytes!)

Sorry, again a “Nerd Show”. I tackle some problems that have come up with the Python script of the last week and show my way to debug and test while making errors. My first error was to take a test case without colours – my script from last week changed all images to greyscale. Then I learn something useful about merging layers in Python.

But the top of the show is even more nerdy – the Octave plugin allows to access the Octave math software from GIMP. Caluculate your images or do a FFT with them.

The scripters crowd in the forum found a bug in GIMP, saulgoode reported it and it got fixed in a day. Take that, Adobe! ;-)

Then I try to explain why the big blobs in the image featured two shows ago are not made with GIMP but with pure physics in the camera. You can see a Blender video I made about this for #200 of Chris Marquards Tips from the Top Floor show. My part starts at about 11:40 and contains an embarrassing error. Do you get it?

This image by Nachbarnebenan is a good example for a shallow DoF.

The next show will be a simple, non-nerd walk through the post processing of an image. Promised.


01:10 Octave Math Plugin
02:10 Number types in Python
06:00 Making a test case
06:30 Finding the wrong layer mode
08:00 Running into a wall and thinking around it
09:40 Isolate the bug
12:40 Cleaning up the code
14:40 Colour halos wit Normal Mode sharpening
16:40 When to use Octave sharpening
17:10 Basics of Photography – Depth of Field and Bokeh
19:00 Image creation with a lens
21:00 Circle of Confusion
22:30 Depth of Field
25:00 Apperture and DoF
28:30 DoF and sensor size
29:00 Dofmaster
30:00 Focal length and DoF

Creative Commons License
Meet the GIMP Video Podcast by Rolf Steinort and Philippe Demartin is licensed under a Creative Commons Attribution-Share Alike 3.0 Germany License.
Permissions beyond the scope of this license may be available at http://meetthegimp.org.

Episode 129: Octave Sharpening Python Plugin

129Download the Video! (77.0 MB, 40:31)
Download the Companion File!

This is the second time I try to get into Python scripting for GIMP. My script in the first show about scripting was simple, just saving some clicks. Now it is more complicated, variables, loops and floating points included. But no parrots!

You find a better version of the programs in the companion file. Following a tip in our Forum I included a Undo Group. So the action can be undone, a behaviour that should have been included from the start.

I mentioned some sources. Instant Python, the official Python Tutorial and the GIMP Python reference. Bert has a script page and a much better version of the Octave sharpening script.

Then we have a UnGIMP composition challenge on the Forum.

Have I forgotten some promised links? Please complain below!


The loop counter in the companion file is set to 6 instead of 4. You can change it back or leave it.

Perhaps it is better to take the image size from drw instead of img. See the discussion in the forum. drw.height and drw.width should work also when the layer is smaller than the image.

Creative Commons License
Meet the GIMP Video Podcast by Rolf Steinort and Philippe Demartin is licensed under a Creative Commons Attribution-Share Alike 3.0 Germany License.
Permissions beyond the scope of this license may be available at http://meetthegimp.org.

How to install Python plugins under GIMP

Please read the comments – some important stuff may have shown up!

Linux – with GUI

Check that the packet gimp-python is installed.

Copy your .py file into the directory .gimp2.4/plug-ins (replace 2.4 with your GIMP version number, 2.6, 2.7, soon 2.8 or, to be future proof, 3.0 ;-)) . This is a hidden directory, you don’t see it in the file browser. With Nautilus you can toggle the display of the hidden files with Ctrl-H.

Then make the file executable by right clicking, selecting “Properties” from the menue and activate “Execute” in the permissions tab.

If GIMP was running, restart it.

Linux – with commandline

Check (with synaptic) that the packet gimp-python is installed.

Enter this:

cp myfile.py ~/.gimp2.4/plug-ins
chmod u+x ~/.gimp2.4/plug-ins/myfile.py

If GIMP was running, restart it.

Mac OS

Please write an instruction into the comments – I’ll pull it up to here.

Look through the comments for a solution – but I think there must be a better one.

EDIT by monoceros84: There is a new discussion going on in the forum. Have a look at: http://forum.meetthegimp.org/index.php/topic,227.0


Copy the files to ~/.gimp2.4/plug-ins

With the following prerequisites:

- PyGTK, PyCairo and PyGobject (all available from the GNOME FTP mirrors as installers) are installed prior to installing GIMP

If GIMP was running, restart it.

Episode 058: White is Grey – and Black too!

Download the Video!
Download the companion file!

Finally the “Zone Adjustment Plugin” – formerly known as “Meaningful Black Script” is shown in its full glory. You find it here and in the companion file.

EDIT: This plugin has evolved tremendously. Go to the Forum entry and search from the last postings backwards for it’s latest incarnation!

And I present a plugin for displaying EXIF information in an image, a split toning plugin and a plugin for applying the “Lazlo Dragan effect”. (Download should now be possible without need to register – sorry, made a mistake in the configuration.) All were published in the Forum of Meet the GIMP.

You can find information about the installation of these plugins there too. Basically you just copy them into your plugin directory (not the scripts directory) and make them executable. The last step is not necessary under Windows.

The show starts with a short introduction into the Zone System of Ansel Adams. Before we go deeper into this, we have to calibrate our cameras. Set your camera to manual mode, set the metering to spot or center based and shot a well exposed image of something middle grey or whitish with a bit of structure in it. I took a white door, but raw concrete is fine too. Then shoot two series of images, the first one closing down one stop in each image, the other in opening up one stop for each step. We’ll look at my images next week.

The TOC:

Ansel Adams and the Zone System 0:27
Calibrating your camera for the Zone System 7:00
Plugins in the Forum 9:36
Working with the “Zone Adjustment Plugin”, formerly know as “meaningful Black” 11:25
Detaching menues in GIMP 12:23
Sample Points 12:50
Finding the Dark and Bright point 15:25
Using the plugint 19:40
The proof: white is grey – and black too! 25:25

The image used in this podcast was made during a performance of Pascale Loiseau from the Belgian  WAZOVOL artists group. I found a video of her performance.

Edit: I changed “script” to plugin – there is a bit of confusion….

Creative Commons License This work is licensed under a
Creative Commons Attribution-Share Alike 2.0 Germany License.

Episode 038: A Phython in a Barrel

Alexanderplatz BerlinDownload the Video!
Download the companion file! (…if there is one…. ;-) )

Will this title scare more people away than catch by curiosity? Who knows…..

The barrel distortion that gave me such problems last week is removed by using a built in filter for correcting (or simulating) lens distortions. You can find it in the image menu at Filters/Distorts/Lens Distortion.

As I have a lot of images with this error, I go out and write a special Python plugin to do this task. It’s not as complicated as it seems – I have a good template and the Web and Gimp give a lot of useful information. You can find the scripts used in this episode here on the Download Page

EDIT: If you are using Windows and GIMP 2.4.x, have a look here for informations about setting up Python for GIMP.
EDIT2: This is supposed to be even easier.

This is the finished Python program:

#!/usr/bin/env python

import math
from gimpfu import *

def remove_barrel_distortion(img, drw):


layer_corr = drw.copy(True)
layer_corr.mode = NORMAL_MODE
layer_corr.name = “Barrel corrected”
img.add_layer(layer_corr, -1)

pdb.plug_in_lens_distortion(img, layer_corr, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0)


“Removes the barrel distortion of a Sanyo CA65″,
“Rolf Steinort <info @meetgimp.org>”,
“public domain”,
“<image>/Filters/Distorts/B_arrel distortion removal CA65″,
“RGB*, GRAY*”,


You find a similar program in this posting. There I have torn it apart and described all the parts. The Python for GIMP documentation and this website can be helpful.

Don’t forget the challenge! Make a monochrome image and post it in our meetthegimp.org photogroup at 23 and be sure to use the tag “mtg-monochrome”. The challenge ends March 31 1600GMT and I’ll draw a winner by random choice.

Contact me!

You can leave your comments on this blog or write me a mail.


00:23 Update from the last episode
01:50 Lens Distortion
06:02 Comments on the blog
08:47 Programming in Python
09:40 – Discussion on the blog
10:56 – Explaining the Python program
20:33 – Procedure browser
25:31 – Parameters
27:35 – Error messages
29:30 – Adding a new layer
32:33 – Summary
34:01 “23″ image hosting
36:09 The End
TOC made by paynekj

Creative Commons License This work is licensed under a
Creative Commons Attribution-Share Alike 2.0 Germany License.