; Coloured outline logo ; Written by Laurence Colombet ; Released under GPL v.2 (define (script-fu-outline-logo text size font fg-color bg-color factor) (let* ( (old-fg (car (gimp-palette-get-foreground))) (old-bg (car (gimp-palette-get-background))) (img (car (gimp-image-new 256 256 RGB))) (border (/ size 4)) (text-layer 0) (width 0) (height 0) (bg-layer 0) ) ; Sets the layers. (gimp-palette-set-foreground bg-color) (gimp-palette-set-background fg-color) (set! text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font))) (set! width (car (gimp-drawable-width text-layer))) (set! height (car (gimp-drawable-height text-layer))) (set! bg-layer (car (gimp-layer-new img width height RGBA_IMAGE "Background" 100 NORMAL))) (gimp-image-resize img width height 0 0) (gimp-layer-set-name text-layer text) (gimp-image-add-layer img bg-layer 1) ; Restore proper colors. (gimp-palette-set-foreground fg-color) (gimp-palette-set-background bg-color) (gimp-selection-layer-alpha text-layer) (gimp-edit-fill text-layer FG-IMAGE-FILL) (gimp-selection-none img) ; Background. (gimp-edit-fill bg-layer BG-IMAGE-FILL) ; Outline text. (plug-in-sobel 1 img text-layer TRUE TRUE TRUE) ; (0, 0), (180, 220), (255, 255) ; (gimp-curves-spline text-layer VALUE-LUT 6 ; (let* ((spline-array (cons-array 6 'byte))) ; (aset spline-array 0 0) ; (aset spline-array 1 0) ; (aset spline-array 2 180) ; (aset spline-array 3 220) ; (aset spline-array 4 255) ; (aset spline-array 5 255) ; spline-array)) (gimp-brightness-contrast text-layer factor factor) ; Too dark, don't know why. (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) (gimp-display-new img) ) ) (script-fu-register "script-fu-outline-logo" _"/Xtns/Script-Fu/Laura/Logos/Outline..." "Coloured outline logo" "Laurence Colombet aka Laura Dove" "Laurence Colombet aka Laura Dove" "2003" "" SF-STRING _"Text" "The GIMP" SF-ADJUSTMENT _"Font Size (pixels)" '(160 2 1000 1 10 0 1) SF-FONT _"Font" "-*-eras-medium-*-*-*-24-*-*-*-*-*-*-*" SF-COLOR _"Text Color" '(0 255 255) SF-COLOR _"Background Color" '(0 0 0) SF-ADJUSTMENT _"Brightness Augmentation" '(80 -127 127 1 10 0 1) )