Skip to content

Instantly share code, notes, and snippets.

@JacksonBates
Created September 14, 2015 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JacksonBates/4f70cfc24fc4ac0c73cf to your computer and use it in GitHub Desktop.
Save JacksonBates/4f70cfc24fc4ac0c73cf to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Tutorial available at: https://www.youtube.com/watch?v=5Ld8Todog5s
# Feedback welcome: jacksonbates@hotmail.com
from gimpfu import *
def extreme_unsharp_desaturation_options(image, drawable, radius, amount, mode):
pdb.gimp_image_undo_group_start(image)
threshold = 0
pdb.plug_in_unsharp_mask(image, drawable, radius, amount, threshold)
pdb.gimp_desaturate_full(drawable, mode)
pdb.gimp_image_undo_group_end(image)
register(
"python-fu-extreme-unsharp-desaturation-options",
"Unsharp mask and desaurate image, with options",
"Run an unsharp mask with variables set by user",
"Jackson Bates", "Jackson Bates", "2015",
"Extreme unsharp and desaturate options...",
"RGB",
[
(PF_IMAGE, "image", "takes current image", None),
(PF_DRAWABLE, "drawable", "Input layer", None),
(PF_SLIDER, "radius", "Radius", 5, (0, 500, 0.5)),
# note extra tuple (min, max, step)
(PF_SLIDER, "amount", "Amount", 5.0, (0, 10, 0.1)),
(PF_RADIO, "mode", "Set Desauration mode: ", DESATURATE_LIGHTNESS,
(
("Lightness", DESATURATE_LIGHTNESS),
( "Luminosity", DESATURATE_LUMINOSITY),
("Average", DESATURATE_AVERAGE)
)
)
],
[],
extreme_unsharp_desaturation_options, menu="<Image>/Filters/Enhance")
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment