On 1/25/07, Kevin Galligan <[EMAIL PROTECTED]> wrote:
I settled on that route after some wrestling...
*** CODE HERE ***
(set! shadowMask (car(gimp-layer-create-mask shadowLayer ADD-ALPHA-MASK)))
(gimp-layer-add-mask shadowLayer shadowMask)
(set! floatingSel (car (gimp-edit-paste shadowMask FALSE)))
(gimp-layer-remove-mask shadowLayer MASK-APPLY)
Is it your intention to apply the mask incrementally? Every time you apply
the mask, that will reduce the alpha of the pixels in shadowlayer.
in short, outAlpha = inAlpha * maskValue.
I hate scheme. I had to do scheme while in school for a class, and I just
never, ever liked it. However, I don't think my problem here was with
scheme (after, obviously, the initial refresher). It was getting my head
around the api. I still don't know how to get a reference to the color
channel (green, blue, or red. Didn't matter. Just needed the values).
If you want to use the 'decompose' plugin to separate the component of an
image, or use Python's advanced slicing to extract data for one component
from the entire pixel data, you can do that.
Do you have a good link to coding python and gimp? I found some stuff, but
it seemed old, and I wound up sticking with scheme.
On Windows it is slightly more complicated to get Gimp working with
Python-Fu. On Linux, it's pretty simple -- just run
./configure with the --enable-python switch (this is enabled by default in
recent versions), then rebuild and reinstall.
Then you can write plugins and put them in your gimp plugins directory.
A simple plugin is attached.
from gimpfu import PLUGIN, PF_INT, PF_IMAGE, PF_DRAWABLE
# this is the usual thing to do, to make pdb more easy to access
# most plugins would make use of the pdb, though this one doesn't.
pdb = gimp.pdb
class Simple (gimpplugin.plugin):
def query (self):
# I didn't want to bother with specifying author, copyright etc just for this example,
# so here's a default string to use
d = ''
gimp.install_procedure ('plug_in_simple', d,d,d,d,d,'<Image>/File/Simple_Test', '*',PLUGIN, [(PF_INT, 'run_mode', "run mode"),(PF_IMAGE, 'image', 'Image'), (PF_DRAWABLE, 'drawable', 'Drawable')], )
# must have class methods corresponding to the pdb entries you register.
# script-fu etc. see this as 'plug-in-simple'
def plug_in_simple (self, run_mode, image, drawable):
def start (self):
def quit (self):
#cleanup here -- usually defining this is unnecessary
if __name__ == '__main__':
Simple ().start ()
Gimp-developer mailing list