Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python plug-in drop shadow
#1
Hello, I am trying to create plugin with drop shadow functionality.
The shadow layer is created, but it behaves as invisible - I can copy the content and put it in other layer, but everything in the shadow layer stays invisible - here is the code:
Code:
#!/usr/bin/env python

from gimpfu import *

def gp_shadow(image, drawable):

   offsetx = 5  
   offsety = 5  
   blurradius = 8
   opacity = 1.0  
   color = gimpcolor.RGB(255,0,0)
   allowresizing = FALSE
   
   pdb.script_fu_drop_shadow(image, drawable, offsetx, offsety, blurradius, color, opacity, allowresizing)
   

register(
   "python-fu-gp_shadow",
   "Drop multipe shadows for GP artwork titles",
   "Drop multipe shadows for GP artwork titles",
   "MK", "MK", "2025",
   "GP shadow",
   "", # 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
   ],
   [],
   gp_shadow, menu="<Image>/Filters/Light and Shadow")  # second item is menu location

main()

Can you find a problem?
(GIMP 2.10.36, Win10)
Reply


Messages In This Thread
python plug-in drop shadow - by marekGP - 7 hours ago

Forum Jump: