Re: [Gimp-developer] Get currently active image in python



On Mon, Mar 19, 2012 at 6:39 AM, Jon Decker <jondecker76 gmail com> wrote:

> I'm at a part where I need to be able to find out the currently active image
> (the image that is selected in gimp).
> I have tried:
> activeImage = gimp.image_list()[0]

When you call the plugin's main function, you will automatically have
access to the current image and drawable.

So something like this:

def my_plugin_function (image, drawable):
    print image

Will output the image object if gimp was started from a terminal.
This is a bare-bones plugin that adds guides to the current image:
http://registry.gimp.org/files/rule_of_thirds_guides.py

HTH,
CHris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]