-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdracula300.scm
189 lines (164 loc) · 8.3 KB
/
dracula300.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
;Modernized with ModernizeMatic7 for Gimp 2.10.22 by vitforlinux.wordpress.com - dont remove
;
; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; Dracula! script for GIMP 2.4
; Chris Gutteridge ([email protected])
; At ECS Dept, University of Southampton, England.
;
; Tags: logo
;
; Author statement:
;I've got a new script, but I've not been able to publish it due it
;network faults + firewalls...
;
;I include it here, should you find a way to publish it for me.
;I appologise for how cheesy it is.
;
;(From the creator of fuzzy-selection and camo etc...)
;
; "Dracula!" or "Cheesy Goth"
;
; --------------------------------------------------------------------
; Distributed by Gimp FX Foundry project
; --------------------------------------------------------------------
; - Changelog -
; Updated to Gimp2.4 (11-2007) http://gimpscripts.com
; Added user selection options for all parameters
;
;
; --------------------------------------------------------------------
;
; 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.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (script-fu-blood-logo300 inText inFont inFontSize justify letter-spacing line-spacing Buffer inBorder inDrip FillColor BorderColor BgType BackgroundColor conserve)
; 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)))
(define (apply-gauss2 img drawable x y)
(cond ((not(defined? 'plug-in-gauss))
(gimp-drawable-merge-new-filter drawable "gegl:gaussian-blur" 0 LAYER-MODE-REPLACE 1.0
"std-dev-x" (* x 0.32) "std-dev-y" (* y 0.32) "filter" "auto"))
(else
(plug-in-gauss 1 img drawable x y 0)
)))
(define (gimp-layer-new-ng ln1 ln2 ln3 ln4 ln5 ln6 ln7)
(if (not (defined? 'gimp-drawable-filter-new))
(gimp-layer-new ln1 ln2 ln3 ln4 ln5 ln6 ln7)
(gimp-layer-new ln1 ln5 ln2 ln3 ln4 ln6 ln7)))
; (define oldFore (car(gimp-context-get-foreground)) )
; (define oldBack (car(gimp-context-get-background)) )
(define theImage (car(gimp-image-new 100 100 RGB)) )
(define textLayer (car(gimp-layer-new-ng theImage 10 10 RGBA-IMAGE _"Text Layer" 100 LAYER-MODE-NORMAL-LEGACY)) )
(define bloodLayer (car(gimp-layer-new-ng theImage 10 10 RGBA-IMAGE _"Blood Layer" 100 LAYER-MODE-NORMAL-LEGACY)) )
(define backLayer (car(gimp-layer-new-ng theImage 10 10 RGBA-IMAGE _"Background" 100 LAYER-MODE-NORMAL-LEGACY)) )
(gimp-context-push)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL-LEGACY )
(gimp-context-set-background BackgroundColor )
(gimp-context-set-foreground FillColor)
(gimp-image-insert-layer theImage backLayer 0 0)
(gimp-image-insert-layer theImage bloodLayer 0 0)
(gimp-image-insert-layer theImage textLayer 0 0)
(gimp-selection-all theImage)
(gimp-drawable-edit-clear textLayer)
(gimp-drawable-edit-clear bloodLayer)
(gimp-selection-none theImage)
(if (not (defined? 'gimp-drawable-filter-new))
(define theText (car (gimp-text-fontname theImage textLayer 0 0 inText Buffer TRUE inFontSize PIXELS inFont )))
(define theText (car (gimp-text-font theImage textLayer 0 0 inText Buffer TRUE inFontSize inFont ))))
(gimp-text-layer-set-justification theText (cond ((= justify 0) 2)
((= justify 1) 0)
((= justify 2) 1)
((= justify 3) 3)))
(gimp-text-layer-set-letter-spacing theText letter-spacing)
(gimp-text-layer-set-line-spacing theText line-spacing)
(define theBuffer (+ inBorder inDrip inDrip))
(gimp-layer-set-offsets theText theBuffer theBuffer)
(define theWidth (+ (car(gimp-drawable-get-width theText)) theBuffer theBuffer) )
(define theHeight (+ (car(gimp-drawable-get-height theText)) theBuffer theBuffer) )
(gimp-image-resize theImage theWidth theHeight 0 0)
(gimp-layer-resize textLayer theWidth theHeight 0 0)
(gimp-layer-resize bloodLayer theWidth theHeight 0 0)
(gimp-layer-resize backLayer theWidth theHeight 0 0)
(gimp-floating-sel-anchor theText)
(gimp-selection-all theImage)
(if (= BgType 0)(gimp-drawable-edit-fill backLayer FILL-BACKGROUND))
(gimp-selection-none theImage)
(gimp-context-set-background BorderColor )
(gimp-image-select-item theImage 0 textLayer)
(gimp-selection-grow theImage inBorder)
(gimp-drawable-edit-fill bloodLayer FILL-BACKGROUND)
(gimp-selection-none theImage)
(gimp-layer-scale bloodLayer theWidth (/ theHeight 8) TRUE)
(define (smear n)
(cond((not(defined? 'plug-in-spread))(if (> n 0)
(gimp-drawable-merge-new-filter bloodLayer "gegl:wind" 0 LAYER-MODE-REPLACE 1.0
"style" "blast" "direction" "bottom" "edge" "leading" "threshold" 10 "strength" (+ 1 (/ n 5))"seed" 10)
(gimp-drawable-merge-new-filter bloodLayer "gegl:wind" 0 LAYER-MODE-REPLACE 1.0
"style" "blast" "direction" "bottom" "edge" "leading" "threshold" 10 "strength" (+ 1 (/ n 10))"seed" 20)
(gimp-drawable-merge-new-filter bloodLayer "gegl:noise-spread" 0 LAYER-MODE-REPLACE 1.0
"amount-x" 0 "amount-y" 2 "seed" 10)
))
(else
(if (> n 0) (begin (plug-in-spread TRUE theImage bloodLayer 0 1) (smear (- n 1)))))))
(smear inDrip)
(gimp-layer-scale bloodLayer theWidth theHeight TRUE)
(gimp-image-select-item theImage 0 textLayer)
(gimp-selection-grow theImage inBorder)
(gimp-drawable-edit-fill bloodLayer FILL-BACKGROUND)
(gimp-selection-none theImage)
(apply-gauss2 theImage bloodLayer 4 4)
; (plug-in-threshold-alpha TRUE theImage bloodLayer 127)
;(gimp-drawable-threshold bloodLayer 0 0.2 0.7)
(apply-gauss2 theImage bloodLayer 3 3)
(gimp-image-select-item theImage 0 bloodLayer)
(gimp-context-set-foreground BorderColor)
(gimp-drawable-edit-bucket-fill bloodLayer FILL-FOREGROUND 0 100)
(gimp-selection-none theImage)
(apply-gauss2 theImage bloodLayer 1 1)
(if (= conserve 0) (define oneLayer (car(gimp-image-flatten theImage)) ))
; (plug-in-autocrop TRUE theImage oneLayer)
;(gimp-context-set-foreground oldFore)
;(gimp-context-set-background oldBack)
(gimp-context-pop)
(gimp-display-new theImage)
)
; Register the function with the GIMP:
(script-fu-register "script-fu-blood-logo300"
_"Dracula 300"
_"Draws the given text string with a border of dripping blood!"
"Christopher Gutteridge"
"1998, Christopher Gutteridge"
"2007, Scott Mosteller"
""
SF-TEXT _"Text" "Dracula!"
SF-FONT _"Font" "QTFraktur Medium"
SF-ADJUSTMENT _"Font Size (pixels)" '(150 2 1000 1 10 0 1)
SF-OPTION _"Text Justification" '("Centered" "Left" "Right")
SF-ADJUSTMENT "Letter Spacing" '(-5 -100 100 1 5 0 0)
SF-ADJUSTMENT "Line Spacing" '(0 -100 100 1 5 0 0)
SF-ADJUSTMENT _"Buffer" '(10 0 99 1 1 0 0)
SF-ADJUSTMENT _"Border Size" '(7 1 99 1 1 0 0)
SF-ADJUSTMENT _"Drip Size" '(5 0 99 1 1 0 0)
SF-COLOR "Fill Color" '(255 255 255)
SF-COLOR "Border Color" '(255 0 0)
SF-OPTION _"Background Fill" '("Color" "Transparent")
SF-COLOR "Background" '(0 0 0)
SF-TOGGLE "Keep the Layers" FALSE
)
(script-fu-menu-register "script-fu-blood-logo300"
"<Image>/File/Create/Logos")