-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexploding-299-happy-new-year-2025.scm
268 lines (231 loc) · 10.4 KB
/
exploding-299-happy-new-year-2025.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
;Modernized with ModernizeMatic7 for Gimp 2.10.22 by vitforlinux.wordpress.com - dont remove
;And a little by hands
; exploding.scm
; creates exploding logos
; (c) 1998 stefan stiasny
;
; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;; Functions to create spline curves to send to gimp-drawable-curves-spline
; 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))))
(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) )))
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(define sffont "QTEurotype Bold")
(define sffont "QTEurotype-Bold"))
(define (script-fu-exploding-logo299-happy-new-year-2025 text size font letter-spacing line-spacing type tcolor tpattern tgrad blur displace_loop blur_toggle crop_toggle ft?)
(let* (
(img (car (gimp-image-new size size RGB)))
(theBgLayer (car (gimp-layer-new img size size RGB "Background" 100 LAYER-MODE-NORMAL-LEGACY)))
(theTextLayer)
(theText)
(theImageWidth)
(theImageHeight)
(theImageSize)
(theBuffer)
(thePolarLayer)
(theNoiseLayer)
(theGreyLayer)
(theMergedLayer)
(i)
(clayer)
(clayer2))
(gimp-image-undo-disable img)
(gimp-context-push)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL-LEGACY)
(gimp-image-insert-layer img theBgLayer 0 0)
(gimp-context-set-background '(255 255 255))
(gimp-context-set-foreground '(0 0 0))
(gimp-drawable-edit-fill theBgLayer 0)
(define theTextLayer (car (gimp-layer-copy theBgLayer 0)))
(gimp-item-set-name theTextLayer "Text")
(gimp-image-insert-layer img theTextLayer 0 0)
; errata (define theText (car (gimp-text-fontname img theTextLayer 50 0 text 0 1 size 1 "*" font "medium" "r" "*" "*" )))
; vecchia (define theText (car (gimp-text-fontname img theTextLayer 50 0 text 0 TRUE size 1 "*" font "medium" "r" "*" "*" "*" "*")))
(define theText (car (gimp-text-fontname img theTextLayer 50 0 text 0 TRUE size 1 font )))
(gimp-text-layer-set-justification theText 2)
(gimp-text-layer-set-letter-spacing theText letter-spacing) ; Set Letter Spacing
(gimp-text-layer-set-line-spacing theText line-spacing) ; Set Line Spacing
(define theImageWidth (+ (car (gimp-drawable-get-width theText)) 100))
(define theImageHeight (+ (car (gimp-drawable-get-height theText)) 100))
(define theImageSize theImageWidth)
(gimp-image-resize img theImageSize theImageSize 0 0)
(gimp-layer-resize theBgLayer theImageSize theImageSize 0 0)
(gimp-layer-resize theTextLayer theImageSize theImageSize 0 0)
(gimp-drawable-edit-clear theBgLayer) ;add
(gimp-drawable-edit-clear theTextLayer) ;add
(define theBuffer (/ (- theImageSize (car(gimp-drawable-get-height theText))) 2 ))
(gimp-layer-set-offsets theText (/ (- theImageSize (car(gimp-drawable-get-width theText))) 2 ) (/ (- theImageSize (car(gimp-drawable-get-height theText))) 2 ))
(gimp-floating-sel-anchor theText)
(apply-gauss img theTextLayer blur blur)
(define (set-pt a index x y)
(begin
(vector-set! a (* index 2) x)
(vector-set! a (+ (* index 2) 1) y)))
(define (spline-exploding)
(let* ((a (make-vector 6 'byte)))
(set-pt a 0 0 0)
(set-pt a 1 127 255)
(set-pt a 2 255 0)
a))
(if (= (string->number (substring (car(gimp-version)) 0 3)) 2.10)
(begin(gimp-drawable-curves-spline theTextLayer 0 6 (spline-exploding))
(gimp-drawable-curves-spline theTextLayer 0 6 (spline-exploding)))
(begin (gimp-drawable-curves-spline theTextLayer 0 (spline-exploding))
(gimp-drawable-curves-spline theTextLayer 0 (spline-exploding))))
(define thePolarLayer (car (gimp-layer-copy theTextLayer 0)))
(gimp-item-set-name thePolarLayer "Polar")
(gimp-image-insert-layer img thePolarLayer 0 1)
(plug-in-polar-coords 1 img thePolarLayer 100.000 0.000 FALSE TRUE FALSE)
(define theNoiseLayer (car (gimp-layer-new img theImageSize 10 RGB "Noise" 100 LAYER-MODE-LIGHTEN-ONLY)))
(define theGreyLayer (car (gimp-layer-new img theImageSize theImageSize RGB "Grey" 100 LAYER-MODE-NORMAL-LEGACY)))
(gimp-image-insert-layer img theNoiseLayer 0 2)
(gimp-image-insert-layer img theGreyLayer 0 3)
(gimp-context-set-background '(128 128 128))
(gimp-context-set-foreground '(0 0 0))
(gimp-drawable-edit-fill theGreyLayer 1)
(gimp-drawable-edit-fill theNoiseLayer 1)
(gimp-drawable-edit-fill theBgLayer 0)
(plug-in-noisify 1 img theNoiseLayer 1 1.0 1.0 1.0 0.00)
(gimp-drawable-desaturate theNoiseLayer 0)
(gimp-layer-scale theNoiseLayer theImageSize theImageSize 1)
(gimp-layer-set-offsets theNoiseLayer 0 0)
(gimp-item-set-visible theBgLayer 0)
(gimp-item-set-visible theTextLayer 0)
(gimp-item-set-visible thePolarLayer 0)
(define theMergedLayer (car (gimp-image-merge-visible-layers img 2)))
(plug-in-displace 1 img thePolarLayer 0.000 -100.000 FALSE TRUE theMergedLayer theMergedLayer 1)
;;(plug-in-blur 1 img thePolarLayer)
;; (plug-in-gauss-iir 1 img thePolarLayer blur TRUE TRUE)
(define i displace_loop)
(cond (> i 1)
(plug-in-displace 1 img thePolarLayer 0.000 -100.000 FALSE TRUE theMergedLayer theMergedLayer 1)
(if (= TRUE blur_toggle)
(apply-gauss img thePolarLayer blur blur))
(define i (- i 1)))
(plug-in-polar-coords 1 img thePolarLayer 100.000 0.000 FALSE TRUE TRUE)
(gimp-drawable-edit-bucket-fill thePolarLayer FILL-FOREGROUND 100 0)
;;; (gimp-drawable-colorize-hsl thePolarLayer hue 100 0);none 2.0
(gimp-item-set-visible theBgLayer 1)
(gimp-item-set-visible theTextLayer 1)
(gimp-item-set-visible thePolarLayer 1)
(gimp-item-set-visible theMergedLayer 0)
(gimp-layer-set-mode theTextLayer LAYER-MODE-SCREEN-LEGACY)
(if (= crop_toggle TRUE)
;(gimp-image-crop img theImageSize (/ theImageSize 2) 0 (/ theImageSize 2))
(plug-in-autocrop TRUE img thePolarLayer)
)
;追å
(apply-gauss img thePolarLayer 2 2)
(define clayer (car (gimp-layer-copy thePolarLayer 0)))
(gimp-image-insert-layer img clayer 0 0)
(cond ((= type 0)
(gimp-item-set-name clayer "tint")
(gimp-context-set-foreground tcolor)
(gimp-drawable-fill clayer FILL-FOREGROUND)
; (gimp-layer-set-mode clayer 5)
(gimp-context-set-paint-mode LAYER-MODE-OVERLAY)
)
( (= type 1)
(gimp-item-set-name clayer "pat")
(gimp-context-set-pattern tpattern)
(gimp-drawable-fill clayer FILL-PATTERN))
( (= type 2)
(gimp-item-set-name clayer "grad")
(gimp-context-set-gradient tgrad)
;(gimp-drawable-fill clayer FILL-PATTERN))
(gimp-context-set-gradient-repeat-mode 0)
(gimp-drawable-edit-gradient-fill
clayer
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
2 ;GRADIENT-LINEAR
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
1
0
0 ;FALSE
(/ theImageWidth 2)
(/ theImageHeight 2)
0
0
)
)
( (= type 3)
(gimp-item-set-name clayer "triple")
(gimp-context-set-gradient tgrad)
;(gimp-drawable-fill clayer FILL-PATTERN))
(gimp-context-set-gradient-repeat-mode 2)
(gimp-drawable-edit-gradient-fill
clayer
;BLEND-FG-TRANSPARENT
;LAYER-MODE-NORMAL-LEGACY
2 ;GRADIENT-LINEAR
0 ; 100
0
;REPEAT-NONE
;FALSE
;FALSE
1
0
0 ;FALSE
(/ theImageWidth 2)
(/ theImageHeight 2)
(/ theImageWidth 3)
(/ theImageHeight 3)
)
)
)
(gimp-layer-set-mode clayer LAYER-MODE-OVERLAY)
(define clayer2 (car (gimp-layer-copy clayer 0)))
(gimp-image-insert-layer img clayer2 0 0)
(if (= ft? TRUE) (gimp-image-merge-visible-layers img 0))
(gimp-context-pop)
(gimp-display-new img)
(gimp-image-undo-enable img)))
(script-fu-register "script-fu-exploding-logo299-happy-new-year-2025"
_"Exploding 299 Happy New Year 2025"
"Exploding Logo Happy New Year 2025"
"Stefan Stiasny"
"Stefan Stiasny"
"11/08/1998"
""
SF-TEXT _"Text" "Happy\nNew Year\n2025"
SF-ADJUSTMENT _"Font size (pixels)" '(100 2 1000 1 10 0 1)
SF-FONT _"Font" sffont
; SF-COLOR "Text Color" '(255 128 0)
SF-ADJUSTMENT _"Letter Spacing" '(0 -100 100 1 5 0 0)
SF-ADJUSTMENT _"Line Spacing" '(0 -200 200 1 5 0 0)
SF-OPTION "Fill with" '("Color" "Pattern" "Gradient" "Gradient triple")
SF-COLOR "Fill Color" '(255 128 0)
SF-PATTERN "Fill Pattern" "Pastel Stuff"
SF-GRADIENT "Fill Gradient" "Tropical Colors"
SF-ADJUSTMENT _"Blur Value" '(7 1 100 1 10 0 1)
SF-ADJUSTMENT _"Displace how often?" '(2 1 5 1 10 0 1)
;;; SF-ADJUSTMENT _"Hue" '(32 1 100 1 10 0 1)
SF-TOGGLE "Multilpe Blur?" FALSE
SF-TOGGLE "Crop?" FALSE
SF-TOGGLE "flatten?" TRUE)
(script-fu-menu-register "script-fu-exploding-logo299-happy-new-year-2025"
"<Image>/File/Create/Logos")