Skip to content

Instantly share code, notes, and snippets.

@JacksonBates
Last active January 14, 2024 14:41
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save JacksonBates/cd98675d58403d295dee to your computer and use it in GitHub Desktop.
Save JacksonBates/cd98675d58403d295dee to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Tutorial available at: https://www.youtube.com/watch?v=nmb-0KcgXzI
# Feedback welcome: jacksonbates@hotmail.com
from gimpfu import *
def NAME_OF_MAIN_FUNCTION(image, drawable):
# function code goes here...
register(
"python-fu-NAME-OF-MAIN-FUNCTION",
"SHORT DESCRIPTION",
"LONG DESCRIPTION",
"Jackson Bates", "Jackson Bates", "2015",
"NAME FOR MENU",
"", # 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
],
[],
NAME_OF_MAIN_FUNCTION, menu="<Image>") # second item is menu location
main()
@Marz007
Copy link

Marz007 commented Jun 10, 2023

Thank you for sharing this awesome template!

@JacksonBates
Copy link
Author

Thank you for sharing this awesome template!

@Marz007 lol, you're welcome - but this is extremely old. I'd be surprised if it still works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment