2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 1637
/ 1 Year ago, wed, december 7, 2022, 8:53:29
I have installed GIMP2.10 in my Ubuntu 16.04. I have the following simple plug-in:
#!/usr/bin/env python
# Tutorial available at: https://www.youtube.com/watch?v=nmb-0KcgXzI
# Feedback welcome: [email protected]
from gimpfu import *
def sample_plugin(image, drawable):
# function code goes here...
print("hello")
register(
"python-fu-sample_plugin",
"SHORT DESCRIPTION",
"LONG DESCRIPTION",
"Jackson Bates", "Jackson Bates", "2015",
"sample_plugin",
"", # type of image it works on (*, RGB, RGB*, RGBA, GRAY etc...)
[
# basic parameters are: (UI_ELEMENT, "variable", "label", Default)
(PF_IMAGE, "image", "takes current image", None),
(PF_DRAWABLE, "drawable", "Input layer", None)
# PF_SLIDER, SPINNER have an extra tuple (min, max, step)
# PF_RADIO has an extra tuples within a tuple:
# eg. (("radio_label", "radio_value), ...) for as many radio buttons
# PF_OPTION has an extra tuple containing options in drop-down list
# eg. ("opt1", "opt2", ...) for as many options
# see ui_examples_1.py and ui_examples_2.py for live examples
],
[],
sample_plugin, menu="<Image>/Filters") # second item is menu location
main()
I saved this as a .py file and placed it at /home//.var/app/org.gimp.GIMP/config/GIMP/2.10/plug-ins
This folder path is already listed in Edit->Preferences->Folders->Plug-ins
When I restart GIMP, I'm not able to find this sample_plugin in the Filters menu. Not able to understand why. This is my first GIMP plug-in
More From » 16.04