5
5
; This script was inspired by Rob Malda's 'coolmetal.gif' graphic
7
7
(define (apply-cool-metal-logo-effect img
13
(let* ((feather (/ size 5))
16
(amplitude (/ size 40))
17
(shrink (+ 1 (/ size 30)))
19
(width (car (gimp-drawable-width logo-layer)))
20
(height (car (gimp-drawable-height logo-layer)))
21
(posx (- (car (gimp-drawable-offsets logo-layer))))
22
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
23
(img-width (+ width (* 0.15 height) 10))
24
(img-height (+ (* 1.85 height) 10))
25
(bg-layer (car (gimp-layer-new img img-width img-height RGB-IMAGE "Background" 100 NORMAL-MODE)))
26
(shadow-layer (car (gimp-layer-new img img-width img-height RGBA-IMAGE "Shadow" 100 NORMAL-MODE)))
27
(reflect-layer (car (gimp-layer-new img width height RGBA-IMAGE "Reflection" 100 NORMAL-MODE)))
17
(amplitude (/ size 40))
18
(shrink (+ 1 (/ size 30)))
20
(width (car (gimp-drawable-width logo-layer)))
21
(height (car (gimp-drawable-height logo-layer)))
22
(posx (- (car (gimp-drawable-offsets logo-layer))))
23
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
24
(img-width (+ width (* 0.15 height) 10))
25
(img-height (+ (* 1.85 height) 10))
26
(bg-layer (car (gimp-layer-new img img-width img-height RGB-IMAGE "Background" 100 NORMAL-MODE)))
27
(shadow-layer (car (gimp-layer-new img img-width img-height RGBA-IMAGE "Shadow" 100 NORMAL-MODE)))
28
(reflect-layer (car (gimp-layer-new img width height RGBA-IMAGE "Reflection" 100 NORMAL-MODE)))
32
34
(gimp-context-push)
99
101
(gimp-context-set-foreground '(255 255 255))
100
102
(gimp-context-set-background '(0 0 0))
101
103
(gimp-edit-blend layer-mask FG-BG-RGB-MODE NORMAL-MODE
102
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
104
0 (- (/ height 2)) 0 height)
104
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
106
0 (- (/ height 2)) 0 height)
106
108
(gimp-image-remove-channel img channel)
111
115
(define (script-fu-cool-metal-logo-alpha img
118
122
(gimp-image-undo-group-start img)
119
123
(apply-cool-metal-logo-effect img logo-layer size bg-color
120
gradient gradient-reverse)
124
gradient gradient-reverse)
121
125
(gimp-image-undo-group-end img)
122
(gimp-displays-flush)))
126
(gimp-displays-flush)
124
130
(script-fu-register "script-fu-cool-metal-logo-alpha"
126
"Metallic logos with reflections and perspective shadows"
127
"Spencer Kimball & Rob Malda"
128
"Spencer Kimball & Rob Malda"
132
SF-DRAWABLE "Drawable" 0
133
SF-ADJUSTMENT _"Effect size (pixels)" '(100 2 1000 1 10 0 1)
134
SF-COLOR _"Background color" '(255 255 255)
135
SF-GRADIENT _"Gradient" "Horizon 1"
136
SF-TOGGLE _"Gradient reverse" FALSE)
132
_"Add a metallic effect to the selected region (or alpha) with reflections and perspective shadows"
133
"Spencer Kimball & Rob Malda"
134
"Spencer Kimball & Rob Malda"
138
SF-DRAWABLE "Drawable" 0
139
SF-ADJUSTMENT _"Effect size (pixels)" '(100 2 1000 1 10 0 1)
140
SF-COLOR _"Background color" "white"
141
SF-GRADIENT _"Gradient" "Horizon 1"
142
SF-TOGGLE _"Gradient reverse" FALSE
138
145
(script-fu-menu-register "script-fu-cool-metal-logo-alpha"
139
_"<Image>/Script-Fu/Alpha to Logo")
146
"<Image>/Filters/Alpha to Logo")
142
149
(define (script-fu-cool-metal-logo text
148
(let* ((img (car (gimp-image-new 256 256 RGB)))
149
(text-layer (car (gimp-text-fontname img -1 0 0 text 0 TRUE
156
(img (car (gimp-image-new 256 256 RGB)))
157
(text-layer (car (gimp-text-fontname img -1 0 0 text 0 TRUE
151
160
(gimp-image-undo-disable img)
152
(gimp-drawable-set-name text-layer text)
153
161
(apply-cool-metal-logo-effect img text-layer size bg-color
154
gradient gradient-reverse)
162
gradient gradient-reverse)
155
163
(gimp-image-undo-enable img)
156
(gimp-display-new img)))
164
(gimp-display-new img)
158
168
(script-fu-register "script-fu-cool-metal-logo"
160
"Metallic logos with reflections and perspective shadows"
161
"Spencer Kimball & Rob Malda"
162
"Spencer Kimball & Rob Malda"
165
SF-STRING _"Text" "Cool Metal"
166
SF-ADJUSTMENT _"Font size (pixels)" '(100 2 1000 1 10 0 1)
167
SF-FONT _"Font" "Crillee"
168
SF-COLOR _"Background color" '(255 255 255)
169
SF-GRADIENT _"Gradient" "Horizon 1"
170
SF-TOGGLE _"Gradient reverse" FALSE)
170
_"Create a metallic logo with reflections and perspective shadows"
171
"Spencer Kimball & Rob Malda"
172
"Spencer Kimball & Rob Malda"
175
SF-STRING _"Text" "Cool Metal"
176
SF-ADJUSTMENT _"Font size (pixels)" '(100 2 1000 1 10 0 1)
177
SF-FONT _"Font" "Crillee"
178
SF-COLOR _"Background color" "white"
179
SF-GRADIENT _"Gradient" "Horizon 1"
180
SF-TOGGLE _"Gradient reverse" FALSE
172
183
(script-fu-menu-register "script-fu-cool-metal-logo"
173
_"<Toolbox>/Xtns/Script-Fu/Logos")
184
"<Toolbox>/Xtns/Logos")