; goose24-border-painted.scm ; by Dave Seaton ; http://thermos.goose24.org ; Version 1.0 (20030606) ; Version 1.0a (2004/09) by Raymond Ostertag : Changed menu entry ; Description ; ; A script-fu script that creates a border for an image that ; looks somewhat painted. ; ; License: ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; The GNU Public License is available at ; http://www.gnu.org/copyleft/gpl.html (define (goose24-border-painted image drawable borderpct thin ragged sloppy smooth ) (let* ((width (car (gimp-image-width image))) (height (car (gimp-image-height image))) (whitelayer (car (gimp-layer-new image width height RGB-IMAGE "Border" 100 NORMAL-MODE))) (paintlayer (car (gimp-layer-new image width height RGB-IMAGE "paint" 100 NORMAL-MODE))) (oldcolor (car (gimp-palette-get-foreground))) (borderpxl (* (min width height) (/ borderpct 100))) ) (gimp-image-undo-disable image) (gimp-image-add-layer image whitelayer -1) (gimp-layer-add-alpha whitelayer) (gimp-drawable-fill whitelayer TRANS-IMAGE-FILL) (gimp-selection-all image) (gimp-selection-shrink image borderpxl) (gimp-selection-invert image) (gimp-palette-set-foreground '(255 255 255)) (gimp-bucket-fill whitelayer FG-BUCKET-FILL NORMAL-MODE 100 255 0 1 1) (gimp-image-add-layer image paintlayer -1) (gimp-layer-add-alpha paintlayer) (gimp-drawable-fill paintlayer TRANS-IMAGE-FILL) (gimp-selection-all image) (gimp-selection-shrink image borderpxl) (gimp-selection-border image borderpxl) (gimp-selection-sharpen image) (script-fu-distress-selection image paintlayer thin ragged sloppy smooth TRUE TRUE) (gimp-palette-set-foreground '(0 0 0)) (gimp-bucket-fill paintlayer FG-BUCKET-FILL NORMAL-MODE 100 255 0 1 1) (gimp-palette-set-foreground oldcolor) (gimp-selection-none image) (gimp-image-merge-down image paintlayer CLIP-TO-BOTTOM-LAYER) (gimp-image-undo-enable image) (gimp-displays-flush))) (script-fu-register "goose24-border-painted" "/Script-Fu/Decor/Painted Border..." "Make a paint-like border" "Dave Seaton" "Dave Seaton" "June 2003" "RGB RGBA GRAY GRAYA" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-ADJUSTMENT "Big" '(10 5 20 1 2 0 0) SF-ADJUSTMENT "Thin" '(127 1 255 1 16 0 0) SF-ADJUSTMENT "Ragged" '(8 1 50 1 1 0 0) SF-ADJUSTMENT "Sloppy" '(4 1 10 1 1 0 0) SF-ADJUSTMENT "Smooth" '(2 1 10 1 1 0 0) )