; Another neon-like logo ; Written by Laurence Colombet ; Released under GPL v.2 (define (script-fu-text-neon-logo text size font grow halogrow neon-color dazzle-color halo-color bg-color) (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)) (neon-layer 0) (width 0) (height 0) (bg-layer 0) (outline-layer 0) (halo-layer 0) ) ; Sets the layers. (gimp-palette-set-foreground halo-color) (set! neon-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font))) (set! width (car (gimp-drawable-width neon-layer))) (set! height (car (gimp-drawable-height neon-layer))) (set! bg-layer (car (gimp-layer-new img width height RGBA_IMAGE "Background" 100 NORMAL))) ; Enlarge or shrink the font before copying the layer. (if (> grow 0) (while (> grow 0) (plug-in-vpropagate 1 img neon-layer 6 15 1 15 0 255) (set! grow (- grow 1)) ) ) (if (< grow 0) (while (< grow 0) (plug-in-vpropagate 1 img neon-layer 7 15 1 15 0 255) (set! grow (+ grow 1)) ) ) (gimp-selection-layer-alpha neon-layer) (gimp-edit-fill neon-layer FG-IMAGE-FILL) (gimp-selection-none img) (set! outline-layer (car (gimp-layer-copy neon-layer TRUE))) (set! halo-layer (car (gimp-layer-copy neon-layer TRUE))) (gimp-image-resize img width height 0 0) (gimp-layer-set-name neon-layer text) (gimp-layer-set-name outline-layer "Outline") (gimp-layer-set-name halo-layer "Halo") (gimp-image-add-layer img outline-layer 1) (gimp-image-add-layer img halo-layer 2) (gimp-image-add-layer img bg-layer 3) ; Background. (gimp-palette-set-background bg-color) (gimp-edit-fill bg-layer BG-IMAGE-FILL) ; Halo. (while (> halogrow 0) (plug-in-vpropagate 1 img halo-layer 6 15 1 15 0 255) (set! halogrow (- halogrow 1)) ) (plug-in-gauss-iir2 1 img halo-layer 50 50) ; Neon tubes. (gimp-palette-set-foreground dazzle-color) (gimp-palette-set-background neon-color) (gimp-selection-layer-alpha neon-layer) (gimp-blend neon-layer FG-BG-RGB NORMAL SHAPEBURST-SPHERICAL 100 0 REPEAT-NONE FALSE 0 0 0 0 1 1) (gimp-selection-none img) ; Outline. ; XXX: Why doesn't the Sobel edge detect recognise the text edges?? (gimp-palette-set-foreground halo-color) (gimp-palette-set-background bg-color) (gimp-selection-layer-alpha outline-layer) (gimp-edit-fill outline-layer BG-IMAGE-FILL) (gimp-selection-none img) (plug-in-sobel 1 img outline-layer TRUE TRUE TRUE) ;(gimp-layer-set-mode outline-layer SCREEN) (gimp-selection-layer-alpha outline-layer) (gimp-edit-fill outline-layer FG-IMAGE-FILL) (gimp-selection-none img) (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) (gimp-display-new img) ) ) (script-fu-register "script-fu-text-neon-logo" _"/Xtns/Script-Fu/Laura/Logos/Neon-like text..." "Very customisable neon-like 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-ADJUSTMENT _"Text Enlargment Factor" '(0 -10 10 1 10 0 1) SF-ADJUSTMENT _"Halo Enlargment Factor" '(4 0 10 1 10 0 1) SF-COLOR _"Neon Color" '(0 255 255) SF-COLOR _"Dazzle Neon Color" '(239 255 255) SF-COLOR _"Halo Color" '(0 0 255) SF-COLOR _"Background Color" '(0 0 0) )