1
; The GIMP -- an image manipulation program
1
; GIMP - The GNU Image Manipulation Program
2
2
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
4
; This program is free software; you can redistribute it and/or modify
5
5
; it under the terms of the GNU General Public License as published by
6
6
; the Free Software Foundation; either version 2 of the License, or
7
7
; (at your option) any later version.
9
9
; This program is distributed in the hope that it will be useful,
10
10
; but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
12
; GNU General Public License for more details.
14
14
; You should have received a copy of the GNU General Public License
15
15
; along with this program; if not, write to the Free Software
16
16
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
20
; Creates snazzy-looking text, inspired by watching a Maxx marathon :)
22
22
(define (apply-comic-logo-effect img
29
(let* ((width (car (gimp-drawable-width logo-layer)))
30
(height (car (gimp-drawable-height logo-layer)))
31
(posx (- (car (gimp-drawable-offsets logo-layer))))
32
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
33
(bg-layer (car (gimp-layer-new img width height RGBA-IMAGE
34
"Background" 100 NORMAL-MODE)))
35
(white-layer (car (gimp-layer-copy logo-layer 1)))
36
(black-layer (car (gimp-layer-copy logo-layer 1))))
30
(width (car (gimp-drawable-width logo-layer)))
31
(height (car (gimp-drawable-height logo-layer)))
32
(posx (- (car (gimp-drawable-offsets logo-layer))))
33
(posy (- (cadr (gimp-drawable-offsets logo-layer))))
34
(bg-layer (car (gimp-layer-new img width height RGBA-IMAGE
35
"Background" 100 NORMAL-MODE)))
36
(white-layer (car (gimp-layer-copy logo-layer 1)))
37
(black-layer (car (gimp-layer-copy logo-layer 1)))
38
40
(gimp-context-push)
45
47
(gimp-image-add-layer img black-layer 1)
46
48
(gimp-layer-translate black-layer posx posy)
47
49
(gimp-drawable-set-name black-layer "Black")
49
51
(gimp-selection-all img)
50
52
(gimp-context-set-background bg-color)
51
53
(gimp-edit-fill bg-layer BACKGROUND-FILL)
52
54
(gimp-selection-none img)
54
(gimp-layer-set-preserve-trans white-layer TRUE)
56
(gimp-layer-set-lock-alpha white-layer TRUE)
55
57
(gimp-context-set-background ol-color)
56
58
(gimp-selection-all img)
57
59
(gimp-edit-fill white-layer BACKGROUND-FILL)
58
(gimp-layer-set-preserve-trans white-layer FALSE)
60
(gimp-layer-set-lock-alpha white-layer FALSE)
59
61
(plug-in-spread 1 img white-layer (* 3 ol-width) (* 3 ol-width))
60
62
(plug-in-gauss-rle 1 img white-layer (* 2 ol-width) 1 1)
61
63
(plug-in-threshold-alpha 1 img white-layer 0)
62
(gimp-layer-set-preserve-trans white-layer TRUE)
64
(gimp-layer-set-lock-alpha white-layer TRUE)
63
65
(gimp-edit-fill white-layer BACKGROUND-FILL)
64
66
(gimp-selection-none img)
66
68
(gimp-context-set-background '(0 0 0))
67
(gimp-layer-set-preserve-trans black-layer TRUE)
69
(gimp-layer-set-lock-alpha black-layer TRUE)
68
70
(gimp-selection-all img)
69
71
(gimp-edit-fill black-layer BACKGROUND-FILL)
70
72
(gimp-selection-none img)
71
(gimp-layer-set-preserve-trans black-layer FALSE)
73
(gimp-layer-set-lock-alpha black-layer FALSE)
72
74
(plug-in-gauss-rle 1 img black-layer ol-width 1 1)
73
75
(plug-in-threshold-alpha 1 img black-layer 0)
75
77
(gimp-context-set-gradient gradient)
76
(gimp-layer-set-preserve-trans logo-layer TRUE)
78
(gimp-layer-set-lock-alpha logo-layer TRUE)
77
79
(gimp-selection-all img)
79
81
(gimp-edit-blend logo-layer CUSTOM-MODE NORMAL-MODE
80
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
82
0 (* height 0.3) 0 (* height 0.78))
82
GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
84
0 (* height 0.3) 0 (* height 0.78))
84
86
(plug-in-noisify 1 img logo-layer 0 0.20 0.20 0.20 0.20)
85
87
(gimp-selection-none img)
86
(gimp-layer-set-preserve-trans logo-layer FALSE)
88
(gimp-layer-set-lock-alpha logo-layer FALSE)
87
89
(gimp-brightness-contrast logo-layer 0 30)
88
90
(plug-in-threshold-alpha 1 img logo-layer 60)
89
91
(gimp-image-set-active-layer img logo-layer)
93
97
(define (script-fu-comic-logo-alpha img
101
105
(gimp-image-undo-group-start img)
102
106
(apply-comic-logo-effect img logo-layer
103
gradient gradient-reverse
104
ol-width ol-color bg-color)
107
gradient gradient-reverse
108
ol-width ol-color bg-color)
105
109
(gimp-image-undo-group-end img)
106
(gimp-displays-flush)))
110
(gimp-displays-flush)
108
114
(script-fu-register "script-fu-comic-logo-alpha"
110
"Comic-book Style Logos"
111
"Brian McFee <keebler@wco.com>"
116
SF-DRAWABLE "Drawable" 0
117
SF-GRADIENT _"Gradient" "Incandescent"
118
SF-TOGGLE _"Gradient reverse" FALSE
119
SF-ADJUSTMENT _"Outline size" '(5 1 100 1 10 0 1)
120
SF-COLOR _"Outline color" '(255 255 255)
121
SF-COLOR _"Background color" '(255 255 255))
116
_"Add a comic-book effect to the selected region (or alpha) by outlining and filling with a gradient"
117
"Brian McFee <keebler@wco.com>"
122
SF-DRAWABLE "Drawable" 0
123
SF-GRADIENT _"Gradient" "Incandescent"
124
SF-TOGGLE _"Gradient reverse" FALSE
125
SF-ADJUSTMENT _"Outline size" '(5 1 100 1 10 0 1)
126
SF-COLOR _"Outline color" "white"
127
SF-COLOR _"Background color" "white"
123
130
(script-fu-menu-register "script-fu-comic-logo-alpha"
124
_"<Image>/Script-Fu/Alpha to Logo")
131
"<Image>/Filters/Alpha to Logo")
127
134
(define (script-fu-comic-logo text
135
142
(let* ((img (car (gimp-image-new 256 256 RGB)))
136
143
(border (/ size 4))
137
(text-layer (car (gimp-text-fontname
138
img -1 0 0 text border TRUE size PIXELS font))))
144
(text-layer (car (gimp-text-fontname
145
img -1 0 0 text border TRUE size PIXELS font))))
139
146
(gimp-image-undo-disable img)
140
(gimp-drawable-set-name text-layer text)
141
147
(apply-comic-logo-effect img text-layer gradient gradient-reverse
142
ol-width ol-color bg-color)
148
ol-width ol-color bg-color)
143
149
(gimp-image-undo-enable img)
144
(gimp-display-new img)))
150
(gimp-display-new img)
146
154
(script-fu-register "script-fu-comic-logo"
148
"Comic-book Style Logos"
149
"Brian McFee <keebler@wco.com>"
153
SF-STRING _"Text" "Moo"
154
SF-ADJUSTMENT _"Font size (pixels)" '(85 2 1000 1 10 0 1)
155
SF-FONT _"Font" "Tribeca"
156
SF-GRADIENT _"Gradient" "Incandescent"
157
SF-TOGGLE _"Gradient reverse" FALSE
158
SF-ADJUSTMENT _"Outline size" '(5 1 100 1 10 0 1)
159
SF-COLOR _"Outline color" '(255 255 255)
160
SF-COLOR _"Background color" '(255 255 255))
156
_"Create a comic-book style logo by outlining and filling with a gradient"
157
"Brian McFee <keebler@wco.com>"
161
SF-STRING _"Text" "Moo"
162
SF-ADJUSTMENT _"Font size (pixels)" '(85 2 1000 1 10 0 1)
163
SF-FONT _"Font" "Tribeca"
164
SF-GRADIENT _"Gradient" "Incandescent"
165
SF-TOGGLE _"Gradient reverse" FALSE
166
SF-ADJUSTMENT _"Outline size" '(5 1 100 1 10 0 1)
167
SF-COLOR _"Outline color" "white"
168
SF-COLOR _"Background color" "white"
162
171
(script-fu-menu-register "script-fu-comic-logo"
163
_"<Toolbox>/Xtns/Script-Fu/Logos")
172
"<Toolbox>/Xtns/Logos")