1
; BLENDED-DROP-SHADOW-LOGO
2
; draw the specified text over a blended background using current gimp fg
3
; and bg colors. The finished blend has a drop shadow underneath that blends
4
; to the specified bg-color
5
; if the blend colors are specified as high intensity, the sharp option
6
; should be enabled or the logo will come out blurry
8
(define (scale size percent) (* size percent))
10
(define (apply-textured-logo-effect img
18
(let* ((b-size-2 (scale b-size 0.5))
19
(f-size (scale b-size 0.75))
20
(ds-size (scale b-size 0.5))
21
(ts-size (- b-size-2 3))
22
(width (car (gimp-drawable-width logo-layer)))
23
(height (car (gimp-drawable-height logo-layer)))
24
(blend-layer (car (gimp-layer-new img width height RGBA-IMAGE
25
"Blend" 100 NORMAL-MODE)))
26
(shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE
27
"Shadow" 100 NORMAL-MODE)))
28
(text-shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE
29
"Text Shadow" 100 MULTIPLY-MODE)))
30
(tsl-layer-mask (car (gimp-layer-create-mask text-shadow-layer
32
(drop-shadow-layer (car (gimp-layer-new img width height RGBA-IMAGE
33
"Drop Shadow" 100 MULTIPLY-MODE)))
34
(dsl-layer-mask (car (gimp-layer-create-mask drop-shadow-layer
39
(script-fu-util-image-resize-from-layer img logo-layer)
40
(gimp-image-add-layer img shadow-layer 1)
41
(gimp-image-add-layer img blend-layer 1)
42
(gimp-image-add-layer img drop-shadow-layer 1)
43
(gimp-image-add-layer img text-shadow-layer 0)
44
(gimp-selection-all img)
45
(gimp-context-set-pattern text-pattern)
46
(gimp-layer-set-preserve-trans logo-layer TRUE)
47
(gimp-edit-bucket-fill logo-layer PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
48
(gimp-selection-none img)
49
(gimp-edit-clear text-shadow-layer)
50
(gimp-edit-clear drop-shadow-layer)
51
(gimp-context-set-background bg-color)
52
(gimp-drawable-fill shadow-layer BACKGROUND-FILL)
53
(gimp-rect-select img b-size-2 b-size-2 (- width b-size) (- height b-size)
54
CHANNEL-OP-REPLACE TRUE b-size-2)
55
(gimp-context-set-background '(0 0 0))
56
(gimp-edit-fill shadow-layer BACKGROUND-FILL)
57
(gimp-selection-layer-alpha logo-layer)
58
(gimp-layer-add-mask text-shadow-layer tsl-layer-mask)
59
(gimp-context-set-background '(255 255 255))
60
(gimp-edit-fill tsl-layer-mask BACKGROUND-FILL)
61
(gimp-selection-feather img f-size)
62
(gimp-context-set-background '(63 63 63))
63
(gimp-edit-fill drop-shadow-layer BACKGROUND-FILL)
64
(gimp-context-set-background '(0 0 0))
65
(gimp-edit-fill text-shadow-layer BACKGROUND-FILL)
66
(gimp-context-set-foreground '(255 255 255))
68
(gimp-edit-blend text-shadow-layer FG-BG-RGB-MODE NORMAL-MODE
69
GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
73
(gimp-selection-none img)
74
(gimp-context-set-foreground blend-fg)
75
(gimp-context-set-background blend-bg)
77
(gimp-edit-blend blend-layer FG-BG-RGB-MODE NORMAL-MODE
78
GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
82
(plug-in-mosaic 1 img blend-layer 12 1 1 0.7 TRUE 135 0.2 TRUE FALSE
85
(gimp-layer-translate logo-layer (- b-size-2) (- b-size-2))
86
(gimp-layer-translate blend-layer (- b-size) (- b-size))
87
(gimp-layer-translate text-shadow-layer (- ts-size) (- ts-size))
88
(gimp-layer-translate drop-shadow-layer ds-size ds-size)
89
(gimp-selection-layer-alpha blend-layer)
90
(gimp-layer-add-mask drop-shadow-layer dsl-layer-mask)
91
(gimp-context-set-background '(255 255 255))
92
(gimp-edit-fill dsl-layer-mask BACKGROUND-FILL)
93
(gimp-layer-remove-mask drop-shadow-layer MASK-APPLY)
94
(gimp-selection-none img)
98
(define (script-fu-textured-logo-alpha img
107
(gimp-image-undo-group-start img)
108
(apply-textured-logo-effect img logo-layer b-size text-pattern tile-type
109
bg-color blend-fg blend-bg)
110
(gimp-image-undo-group-end img)
111
(gimp-displays-flush)))
113
(script-fu-register "script-fu-textured-logo-alpha"
115
"Creates textured logos with blended backgrounds, highlights, and shadows"
121
SF-DRAWABLE "Drawable" 0
122
SF-ADJUSTMENT _"Border size (pixels)" '(20 1 100 1 10 0 1)
123
SF-PATTERN _"Pattern" "Fibers"
124
SF-OPTION _"Mosaic tile type" '(_"Squares"
127
SF-COLOR _"Background color" '(255 255 255)
128
SF-COLOR _"Starting blend" '(32 106 0)
129
SF-COLOR _"Ending blend" '(0 0 106))
131
(script-fu-menu-register "script-fu-textured-logo-alpha"
132
_"<Image>/Script-Fu/Alpha to Logo")
135
(define (script-fu-textured-logo text
143
(let* ((img (car (gimp-image-new 256 256 RGB)))
144
(b-size (scale size 0.1))
145
(text-layer (car (gimp-text-fontname img -1 0 0 text b-size
146
TRUE size PIXELS fontname))))
147
(gimp-image-undo-disable img)
148
(gimp-drawable-set-name text-layer text)
149
(apply-textured-logo-effect img text-layer b-size text-pattern tile-type
150
bg-color blend-fg blend-bg)
151
(gimp-image-undo-enable img)
152
(gimp-display-new img)))
154
(script-fu-register "script-fu-textured-logo"
156
"Creates textured logos with blended backgrounds, highlights, and shadows"
161
SF-STRING _"Text" "The GIMP"
162
SF-ADJUSTMENT _"Font size (pixels)" '(200 1 1000 1 10 0 1)
163
SF-FONT _"Font" "CuneiFont"
164
SF-PATTERN _"Text pattern" "Fibers"
165
SF-OPTION _"Mosaic tile type" '(_"Squares"
168
SF-COLOR _"Background color" '(255 255 255)
169
SF-COLOR _"Starting blend" '(32 106 0)
170
SF-COLOR _"Ending blend" '(0 0 106))
172
(script-fu-menu-register "script-fu-textured-logo"
173
_"<Toolbox>/Xtns/Script-Fu/Logos")