#!/usr/bin/env python # # Python-Fu template, fill in the blanks and have fun :) # # (C) 2004-2009 Simon Budig # # This template is in the public domain, I'd like to encourage you to # place your script under the GPL or LGPL. from gimpfu import * def python_fu_template(image, drawable, color): gimp.context_push() image.undo_group_start() (x0, y0) = drawable.offsets pdb.gimp_rect_select(image, x0 + drawable.width / 4, y0 + drawable.height / 4, drawable.width / 2, drawable.height / 2, CHANNEL_OP_REPLACE, 0, 0) gimp.set_foreground(color) pdb.gimp_edit_fill(drawable, FOREGROUND_FILL) image.undo_group_end() gimp.displays_flush() gimp.context_pop() register( "python-fu-template", "Python-Fu template (right now renders just a rectangle)", "more help could be added here", "Simon Budig ", "Simon Budig", "2009-01-08", "Python-Fu Template...", "RGB* GRAY*", [ (PF_IMAGE, "image", "Input Image", 0), (PF_DRAWABLE, "drawable", "Input Drawable", 0), (PF_COLOR, "color", "Rectangle Color", "orange") ], [], python_fu_template, menu="/Filters/Python-Fu/Render") main()