; ; "Graynite" slab (Granite? I don't know...) ; ; Based on "Graynite button" script. This uses BumpMaps (Read: Much cooler!) ; ; Copyright (C) 8.3.1998 by Urpo Lankinen. ; Original version (granitebutton.scm): ; Copyright (C) 15.12.1997 by Urpo Lankinen. ; Distributed under GPL. Permission granted to distribute this script ; with anything that has something to do with The GIMP. ; ; RCS: $Id: graniteslab.scm,v 1.1 1998/05/10 06:25:46 urpo Exp urpo $ ; ; Changed on June 15, 2000 by Kevin Cozens ; Updated for GIMP 1.1.26 ; ; Changed on December 8, 2003 by Kevin Cozens ; Updated for GIMP 1.2 ; ; Changed on January 29, 2004 by Kevin Cozens ; Updated for GIMP 2.0pre3 (define (script-fu-granite-slab text font size slabedge slabdepth textdepth carvetog) (let* ((img (car (gimp-image-new 256 256 GRAY))) (bg-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) (text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) (width (car (gimp-drawable-width text-layer))) (height (car (gimp-drawable-height text-layer))) (white-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) (brd-layer (car (gimp-layer-new img width height GRAYA-IMAGE "border" 100 NORMAL-MODE))) (old-fg (car (gimp-palette-get-foreground))) (old-bg (car (gimp-palette-get-background)))) (gimp-image-undo-disable img) (gimp-drawable-set-name text-layer "Text") (gimp-drawable-set-name white-layer "White") (gimp-image-lower-layer img white-layer) (gimp-drawable-set-name bg-layer "Bg") (gimp-image-resize img width height 0 0) ; (set! amount (* height (/ 1 16))) ; ÄKSÖN ========================================================= (gimp-image-set-active-layer img text-layer) (gimp-palette-set-foreground '(0 0 0)) ; Add the border layer (gimp-image-add-layer img brd-layer 2) (gimp-image-set-active-layer img brd-layer) (gimp-edit-clear brd-layer) ; do the plasma and make it gray (gimp-image-set-active-layer img bg-layer) (plug-in-plasma 1 bg-layer bg-layer 42 3.2) (gimp-brightness-contrast bg-layer -60 -110) ; Do the borders (gimp-image-set-active-layer img brd-layer) (gimp-selection-all img) (gimp-palette-set-foreground '(255 255 255)) (gimp-edit-bucket-fill brd-layer FG-BUCKET-FILL NORMAL-MODE 100 0 0 0 0) (gimp-palette-set-foreground '(0 0 0)) (gimp-selection-border img slabedge) (gimp-edit-bucket-fill brd-layer FG-BUCKET-FILL NORMAL-MODE 100 0 0 0 0) (gimp-selection-none img) (gimp-drawable-set-visible bg-layer 0) (gimp-drawable-set-visible brd-layer 1) (gimp-drawable-set-visible text-layer 0) (gimp-drawable-set-visible white-layer 0) ; OK, the borders are in order. Bump-map? Just say YES! (gimp-drawable-set-visible bg-layer 1) (gimp-image-set-active-layer img bg-layer) (plug-in-bump-map 1 img bg-layer brd-layer 135 45 slabdepth 0 0 0 0 1 0 GRADIENT-LINEAR) ; (gimp-drawable-delete brd-layer) ; Strange. the previous line crashes GIMP. Hmmm... ; Do the "Black text on white bg" trick (gimp-drawable-set-visible bg-layer 0) (gimp-drawable-set-visible brd-layer 0) (gimp-drawable-set-visible text-layer 1) (gimp-drawable-set-visible white-layer 1) (gimp-image-set-active-layer img white-layer) (gimp-selection-all img) (gimp-palette-set-foreground '(255 255 255)) (gimp-edit-bucket-fill white-layer FG-BUCKET-FILL NORMAL-MODE 100 0 0 0 0) (gimp-palette-set-foreground '(0 0 0)) (gimp-selection-none img) (set! text-layer (car (gimp-image-merge-visible-layers img EXPAND-AS-NECESSARY))) (plug-in-blur 1 img text-layer) (plug-in-bump-map 1 img bg-layer text-layer 135 45 textdepth 0 0 0 0 1 (if (eq? carvetog FALSE) 1 0) GRADIENT-LINEAR) (gimp-drawable-set-visible bg-layer 1) (gimp-drawable-set-visible text-layer 0) ; End of Action(tm) ============================================= (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) (gimp-image-undo-enable img) (gimp-display-new img))) ; ; Hajaa-ho! ; (script-fu-register "script-fu-granite-slab" "/Xtns/Script-Fu/Logos/Granite slab" "Makes a granite slab with a text. $Revision: 1.1 $" "Urpo Lankinen " "Urpo Lankinen " "1998" "" SF-STRING "Text String" "Graynite" SF-FONT "Font" "Becker" SF-ADJUSTMENT "Font Size (pixels)" '(50 2 1000 1 10 0 1) SF-VALUE "Edge of the slab" "5" SF-VALUE "Depth of the slab" "3" SF-VALUE "Depth of the text" "5" SF-TOGGLE "Carve" FALSE)