|
Hi Kevin, here is my code ------------------------------------------------------------------------------------------ #!/usr/bin/env python # -*- coding: utf-8 -*- from gimpfu import *
# # create a function which sends msg to gimp's Error Console #
def gprint( text ): pdb.gimp_message(text) return
# # definition of the script # name must correspond to the name # at the bottom of the registration, before menu #
def enhancecolors(inImage, inDrawable, inOpacity) :
gprint("Hello from my script!") gprint("You sent me this level of opacity: %d"%inOpacity)
# Store the GIMP's settings so they can be restored when we're finished gimp.context_push()
# Make all the operations in this filter undo in one group inImage.undo_group_start()
copiedDrawable=pdb.gimp_layer_copy(inDrawable, TRUE) pdb.gimp_image_add_layer(inImage, copiedDrawable, -1) pdb.gimp_selection_all(inImage) pdb.gimp_image_set_active_layer(inImage, copiedDrawable) fgc=pdb.plug_in_borderaverage(inImage, copiedDrawable, 3, 16)
#pdb.plug_in_colortoalpha(inImage, copiedDrawable, fgc)
inImage.undo_group_end() gimp.context_pop()
return
# This is the plugin registration function register( "enhancecolors", "to enhance pale colors", "This script does make colors more vivid", "Diego", "Diego Nassetti ", "February 2013", "enhancecolors", "*", [ (PF_IMAGE, "image", "Input image", None), (PF_DRAWABLE, "drawable", "Input drawable", None), (PF_SLIDER, 'opacity', 'opacity level:', 50, (10, 100, 10)) ], [], enhancecolors, menu="<Image>/Additional/Diego/", )
main() ------------------------------------------------------------------------------------------- I hope you can find where my errors are, thanks
_________________ "Where am I ?"
|