-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstained-glass-logo-299_16.scm
253 lines (220 loc) · 8.35 KB
/
stained-glass-logo-299_16.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
;Modernized with ModernizeMatic7 for Gimp 2.10.22 by vitforlinux.wordpress.com - dont remove
;************************************************ *********
; Tested with GIMP 2.8 an 2.10.22/30
;************************************************ *********
; Fix code for gimp 2.99.6 working in 2.10
(cond ((not (defined? 'gimp-drawable-get-width)) (define gimp-drawable-get-width gimp-drawable-width)))
(cond ((not (defined? 'gimp-drawable-get-height)) (define gimp-drawable-get-height gimp-drawable-height)))
(cond ((not (defined? 'gimp-text-fontname)) (define (gimp-text-fontname fn1 fn2 fn3 fn4 fn5 fn6 fn7 fn8 PIXELS fn9) (gimp-text-font fn1 fn2 fn3 fn4 fn5 fn6 fn7 fn8 fn9))))
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(define sffont "QTBookmann Bold")
(define sffont "QTBookmann-Bold"))
(define (apply-gauss img drawable x y)(begin (if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(plug-in-gauss 1 img drawable x y 0)
(plug-in-gauss 1 img drawable (* x 0.32) (* y 0.32) 0) )))
(define (apply-super-logos04-effect image logo-layer tsize tspc random blur offset sf ft-color bg-color lwidth bgmosaic flatten)
(let* (
(bump-layer 0)
(v_point 0)
(path-layer 0)
(outline-layer 0)
(width (car (gimp-drawable-get-width logo-layer))) ; logo width
(height (car (gimp-drawable-get-height logo-layer))) ; logo height
(bg-layer (car (gimp-layer-new image width height RGB-IMAGE "Background" 100 LAYER-MODE-NORMAL-LEGACY))) ; background layer
(fg-color '(0 0 0)) ) ; foreground color=black
; (bg-color '(20 20 20)) ) ;background color=white
(gimp-context-push)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL-LEGACY )
; Image resizing and background layer creation
(gimp-image-insert-layer image bg-layer 0 1) ;Add background layer under logo-layer
(gimp-image-resize-to-layers image) ;Resize image to layers
(gimp-selection-none image) ;no selection
(gimp-context-set-background bg-color) ; background mosaic color
(gimp-drawable-edit-fill bg-layer FILL-BACKGROUND) ; Fill background layer with background mosaic color
(if (= bgmosaic 1)
(plug-in-mosaic 1 image bg-layer ; mosaic drawing
tsize
4
tspc
0.65
1
135
0.2
1
1
1
0
0)
) ;
; Create image for bump map
(set! bump-layer (car(gimp-layer-copy logo-layer 1))) ; copy logo-layer
;(gimp-item-set-name bump-layer "bump")
(gimp-image-insert-layer image bump-layer 0 -1) ;Add bump-layer to Top
(gimp-image-raise-item-to-top image bump-layer)
(gimp-item-set-name bump-layer "Text")
; Plasma/mosaic drawing on text
(gimp-image-select-item image 2 logo-layer) ; AlphaChanel to SelecdtionMask
(gimp-image-select-rectangle image 0 0 0 1 1) ; plasma fix
(plug-in-plasma 1 image logo-layer random 7) ; plasma drawing
(gimp-image-select-rectangle image 1 0 0 1 1) ; end plasma fix
(plug-in-oilify 1 image logo-layer 5 1)
(gimp-context-set-background fg-color) ; set background color to black
(plug-in-mosaic 1 image logo-layer ; mosaic drawing
tsize
4
tspc
0.65
1
135
0.2
1
1
1
sf
1)
(set! v_point (cons-array 8 'byte)) ; adjust brightness and contrast
(set-pt v_point 0 0 0 )
(set-pt v_point 1 0.25098 0.25098 )
(set-pt v_point 2 0.5 0.88627 )
(set-pt v_point 3 1 1 )
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(gimp-drawable-curves-spline logo-layer HISTOGRAM-VALUE 8 v_point)
(gimp-drawable-curves-spline logo-layer HISTOGRAM-VALUE v_point))
(gimp-selection-none image)
; draw outline
; Convert text to path
(gimp-image-select-item image 2 bump-layer) ;select text
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(plug-in-sel2path 1 image bump-layer)
(plug-in-sel2path 1 image (vector bump-layer))) ;
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(gimp-item-set-name (car (gimp-image-get-active-vectors image)) "Path")
(gimp-item-set-name (vector-ref (car (gimp-image-get-selected-paths image)) 0) "Path")
)
;(gimp-item-set-name (car (gimp-image-get-active-vectors image)) "Path")
;(gimp-item-set-name (aref (cadr (gimp-image-get-selected-vectors image)) 0) "Path")
(gimp-selection-none image)
(set! path-layer (car (gimp-layer-new image width height RGBA-IMAGE "Path" 100 LAYER-MODE-NORMAL-LEGACY)))
(gimp-image-insert-layer image path-layer 0 -1 ) ;Add new layer path-layer
(gimp-selection-all image)
(gimp-drawable-edit-clear path-layer)
(gimp-context-set-foreground fg-color)
(define brush-array (vector "Circle (05)" "Circle (07)" "Circle (09)" "Circle (11)" "Circle (13)" "Circle (15)" "Circle (17)" "Circle (19)"))
; (gimp-context-set-dynamics "Dynamics Off")
(gimp-context-set-dynamics "Pressure Opacity")
;(gimp-context-enable-dynamics FALSE)
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(gimp-context-set-brush "2. Hardness 100")
(gimp-context-set-brush (car (gimp-brush-get-by-name "2. Hardness 100"))))
(gimp-context-set-brush-size lwidth)
(gimp-context-set-brush-spacing 0.1)
;(gimp-path-stroke-current image)
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(gimp-drawable-edit-stroke-item path-layer (car (gimp-image-get-active-vectors image)))
(gimp-drawable-edit-stroke-item path-layer (car (gimp-image-get-path-by-name image "Path"))) )
(set! outline-layer (car(gimp-layer-copy path-layer 1)))
(gimp-image-insert-layer image outline-layer 0 0)
(gimp-item-set-name outline-layer "Outline")
(gimp-item-set-visible bump-layer 0)
(gimp-context-set-background ft-color) ;Text border color
(gimp-image-select-item image 2 outline-layer) ;select non-transparent
;(gimp-edit-blend outline-layer ; drawable
;BLEND-FG-BG-RGB ;blend_mode
;LAYER-MODE-NORMAL-LEGACY ;paint_mode
;GRADIENT-SHAPEBURST-SPHERICAL ;gradient_type
;100 ;opacity
;0 ;offset
;REPEAT-NONE ;repeat
;TRUE ;reverse
;FALSE ;supersample
;0 ;max_depth(supersample)
;0 ;threshold(supersample)
;TRUE ;dither
;width
;height
;(+ width 20)
;height)
(gimp-context-set-gradient-fg-bg-rgb)
(gimp-context-set-gradient-reverse TRUE)
(gimp-drawable-edit-gradient-fill
outline-layer
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
7 ;GRADIENT-SHAPEBURST-SPHERICAL
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
1
0
0 ;FALSE
width
height
(+ width 20)
height
)
(gimp-selection-none image) ;deselection
(plug-in-bump-map 1 image outline-layer outline-layer 135 45 3 0 0 0 0 1 0 0 )
(plug-in-oilify 1 image outline-layer 2 1)
;(gimp-layer-set-lock-alpha outline-layer TRUE)
(apply-gauss image outline-layer 2 2)
(gimp-drawable-brightness-contrast outline-layer 0 0.2)
(apply-gauss image path-layer blur blur)
(gimp-layer-set-offsets path-layer offset offset)
(gimp-selection-none image) ;no selection
(if (= flatten 1)
(gimp-image-flatten image) ; image flattening
)(gimp-context-pop)
);end of let*
);end of define
(define (script-fu-super-logos04s text size fontname tsize tspc random blur offset sf col bcol lwidth bgmosaic flatten)
(let*
(
(img 0)
(text-layer 0)
)
(set! img (car (gimp-image-new 256 256 RGB)))
(gimp-context-push)
(gimp-context-set-foreground '(0 0 0) )
(set! text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS fontname)))
(gimp-image-undo-disable img)
(gimp-item-set-name text-layer text)
(apply-super-logos04-effect img text-layer tsize tspc random blur offset sf col bcol lwidth bgmosaic flatten) ;FONT EFFECT
(gimp-image-undo-enable img)
(gimp-context-pop)
(gimp-display-new img)
)
)
(define
(set-pt a index x y)
(begin
(vector-set! a (* index 2) x)
(vector-set! a (+ (* index 2) 1) y)
)
)
(script-fu-register
"script-fu-super-logos04s" ;Script name
"Stained Glass Logo" ;Menu
"Super Logos No.04 beta" ;Description
"RETOUCH-SCRIPT" ;Creator
"copyright 2006, RETOUCH-SCRIPT" ;copyright notice
"Nov 01, 2006" ;date created
""
SF-STRING "Text" "GIMP 2.99.18"
SF-ADJUSTMENT "Font size (pixels)" '(150 2 1000 1 10 0 0)
SF-FONT "Font" sffont
SF-ADJUSTMENT "Tile size" '(20 5 100 1 10 0 0)
SF-ADJUSTMENT "Tile spacing" '(1 1 100 1 10 0 0)
SF-ADJUSTMENT "Random seed" '(1000 0 2000 5 10 0 0)
SF-ADJUSTMENT "Shadow blur" '(3 0 30 1 10 0 0)
SF-ADJUSTMENT "Shadow offset" '(1 0 30 1 10 0 0)
SF-TOGGLE "Surface relief" FALSE
SF-COLOR "Rim color" '(255 255 255)
SF-COLOR "Background color" '(255 255 255)
SF-ADJUSTMENT "Line Thickness :-) " '(5 1 100 1 10 0 0)
SF-TOGGLE "Stained Background" FALSE
SF-TOGGLE "Flatten layers" FALSE
); end of register
(script-fu-menu-register "script-fu-super-logos04s" "<Image>/File/Create/Logos"
)