2
2
; Create a text effect that simulates an eerie alien glow around text
4
(define (find-blend-coords w
6
(let* ((denom (+ (/ w h) (/ h w)))
7
(bx (/ (* -2 h) denom))
8
(by (/ (* -2 w) denom)))
11
(define (find-nova-x-coord drawable
26
(while (and (= clearance 0) (> limit 0))
27
(set! x (+ (rand range) x1))
28
(set! val (cadr (gimp-drawable-get-pixel drawable x y)))
29
(set! val-left (cadr (gimp-drawable-get-pixel drawable (- x min-clearance) y)))
30
(set! val-right (cadr (gimp-drawable-get-pixel drawable (+ x min-clearance) y)))
31
(set! val-top (cadr (gimp-drawable-get-pixel drawable x (- y min-clearance))))
32
(set! val-bottom (cadr (gimp-drawable-get-pixel drawable x (+ y min-clearance))))
33
(if (and (= (aref val alpha) 0) (= (aref val-left alpha) 0) (= (aref val-right alpha) 0)
34
(= (aref val-top alpha) 0) (= (aref val-bottom alpha) 0))
35
(set! clearance 1) (set! limit (- limit 1))))
38
(define (apply-starscape-logo-effect img
42
(let* ((border (/ size 4))
47
(shadow-feather (/ size 25))
48
(width (car (gimp-drawable-width logo-layer)))
49
(height (car (gimp-drawable-height logo-layer)))
50
(w (* (/ (- width (* border 2)) 2.0) 0.75))
51
(h (* (/ (- height (* border 2)) 2.0) 0.75))
52
(novay (* height 0.3))
53
(novax (find-nova-x-coord logo-layer (* width 0.2) (* width 0.8) novay))
54
(novaradius (/ (min height width) 7.0))
57
(bx (+ cx (car (find-blend-coords w h))))
58
(by (+ cy (cdr (find-blend-coords w h))))
59
(bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
60
(glow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Glow" 100 NORMAL-MODE)))
61
(shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Drop Shadow" 100 NORMAL-MODE)))
62
(bump-channel (car (gimp-channel-new img width height "Bump Map" 50 '(0 0 0)))))
4
(define (apply-starscape-logo-effect img logo-layer size glow-color)
6
(define (find-blend-coords w h)
8
(denom (+ (/ w h) (/ h w)))
9
(bx (/ (* -2 h) denom))
10
(by (/ (* -2 w) denom))
16
(define (find-nova-x-coord drawable x1 x2 y)
31
(while (and (= clearance 0) (> limit 0))
32
(set! x (+ (rand range) x1))
33
(set! val (cadr (gimp-drawable-get-pixel drawable x y)))
34
(set! val-left (cadr (gimp-drawable-get-pixel drawable (- x min-clearance) y)))
35
(set! val-right (cadr (gimp-drawable-get-pixel drawable (+ x min-clearance) y)))
36
(set! val-top (cadr (gimp-drawable-get-pixel drawable x (- y min-clearance))))
37
(set! val-bottom (cadr (gimp-drawable-get-pixel drawable x (+ y min-clearance))))
38
(if (and (= (aref val alpha) 0) (= (aref val-left alpha) 0)
39
(= (aref val-right alpha) 0) (= (aref val-top alpha) 0)
40
(= (aref val-bottom alpha) 0)
43
(set! limit (- limit 1))
56
(shadow-feather (/ size 25))
57
(width (car (gimp-drawable-width logo-layer)))
58
(height (car (gimp-drawable-height logo-layer)))
59
(w (* (/ (- width (* border 2)) 2.0) 0.75))
60
(h (* (/ (- height (* border 2)) 2.0) 0.75))
61
(novay (* height 0.3))
62
(novax (find-nova-x-coord logo-layer (* width 0.2) (* width 0.8) novay))
63
(novaradius (/ (min height width) 7.0))
66
(bx (+ cx (car (find-blend-coords w h))))
67
(by (+ cy (cdr (find-blend-coords w h))))
68
(bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
69
(glow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Glow" 100 NORMAL-MODE)))
70
(shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE "Drop Shadow" 100 NORMAL-MODE)))
71
(bump-channel (car (gimp-channel-new img width height "Bump Map" 50 '(0 0 0))))
64
74
(gimp-context-push)
104
114
(gimp-context-set-pattern "Stone")
105
115
(gimp-edit-bucket-fill bump-channel PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
106
116
(plug-in-bump-map 1 img logo-layer bump-channel
107
135.0 45.0 4 0 0 0 0 FALSE FALSE 0)
117
135.0 45.0 4 0 0 0 0 FALSE FALSE 0)
108
118
(gimp-image-remove-channel img bump-channel)
109
119
(gimp-selection-none img)
114
(define (script-fu-starscape-logo-alpha img
125
(define (script-fu-starscape-logo-alpha img logo-layer size glow-color)
119
127
(gimp-image-undo-group-start img)
120
128
(apply-starscape-logo-effect img logo-layer size glow-color)
121
129
(gimp-image-undo-group-end img)
122
(gimp-displays-flush)))
130
(gimp-displays-flush)
124
134
(script-fu-register "script-fu-starscape-logo-alpha"
126
"Starscape using the Nova plug-in"
132
SF-DRAWABLE "Drawable" 0
133
SF-ADJUSTMENT _"Effect size (pixels * 4)" '(150 1 1000 1 10 0 1)
134
SF-COLOR _"Glow color" '(28 65 188))
136
_"Fill the selected region (or alpha) with a rock-like texture, a nova glow, and shadow"
142
SF-DRAWABLE "Drawable" 0
143
SF-ADJUSTMENT _"Effect size (pixels * 4)" '(150 1 1000 1 10 0 1)
144
SF-COLOR _"Glow color" '(28 65 188)
136
147
(script-fu-menu-register "script-fu-starscape-logo-alpha"
137
_"<Image>/Script-Fu/Alpha to Logo")
140
(define (script-fu-starscape-logo text
144
(let* ((img (car (gimp-image-new 256 256 RGB)))
146
(text-layer (car (gimp-text-fontname img -1 0 0 text border
147
TRUE size PIXELS fontname))))
148
"<Image>/Filters/Alpha to Logo")
151
(define (script-fu-starscape-logo text size fontname glow-color)
153
(img (car (gimp-image-new 256 256 RGB)))
155
(text-layer (car (gimp-text-fontname img -1 0 0 text border
156
TRUE size PIXELS fontname)))
148
158
(gimp-image-undo-disable img)
149
(gimp-drawable-set-name text-layer text)
150
159
(apply-starscape-logo-effect img text-layer size glow-color)
151
160
(gimp-image-undo-enable img)
152
(gimp-display-new img)))
161
(gimp-display-new img)
154
165
(script-fu-register "script-fu-starscape-logo"
156
"Starscape using the Nova plug-in"
161
SF-STRING _"Text" "Nova"
162
SF-ADJUSTMENT _"Font size (pixels)" '(150 1 1000 1 10 0 1)
163
SF-FONT _"Font" "Engraver"
164
SF-COLOR _"Glow color" '(28 65 188))
167
_"Create a logo using a rock-like texture, a nova glow, and shadow"
172
SF-STRING _"Text" "Nova"
173
SF-ADJUSTMENT _"Font size (pixels)" '(150 1 1000 1 10 0 1)
174
SF-FONT _"Font" "Engraver"
175
SF-COLOR _"Glow color" '(28 65 188)
166
178
(script-fu-menu-register "script-fu-starscape-logo"
167
_"<Toolbox>/Xtns/Script-Fu/Logos")
179
"<Toolbox>/Xtns/Logos")