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.
18
18
; chalk.scm version 0.11 10/10/97
20
20
; Copyright (C) 1997 Manish Singh <msingh@uclink4.berkeley.edu>
22
22
; Makes a logo with a chalk-like text effect.
24
24
(define (apply-chalk-logo-effect img
27
(let* ((width (car (gimp-drawable-width logo-layer)))
28
(height (car (gimp-drawable-height logo-layer)))
29
(bg-layer (car (gimp-layer-new img
30
width height RGB-IMAGE
31
"Background" 100 NORMAL-MODE))))
28
(width (car (gimp-drawable-width logo-layer)))
29
(height (car (gimp-drawable-height logo-layer)))
30
(bg-layer (car (gimp-layer-new img
31
width height RGB-IMAGE
32
"Background" 100 NORMAL-MODE)))
33
35
(gimp-context-push)
39
41
(gimp-edit-fill bg-layer BACKGROUND-FILL)
41
43
; the actual effect
42
(gimp-layer-set-preserve-trans logo-layer FALSE)
44
(gimp-layer-set-lock-alpha logo-layer FALSE)
43
45
(plug-in-gauss-rle 1 img logo-layer 2.0 1 1)
44
46
(plug-in-spread 1 img logo-layer 5.0 5.0)
45
47
(plug-in-ripple 1 img logo-layer 27 2 0 0 0 TRUE TRUE)
53
55
(gimp-edit-clear logo-layer)
54
56
(gimp-selection-none img)
59
63
(define (script-fu-chalk-logo-alpha img
63
67
(gimp-image-undo-group-start img)
64
68
(apply-chalk-logo-effect img logo-layer bg-color)
65
69
(gimp-image-undo-group-end img)
66
(gimp-displays-flush)))
68
74
(script-fu-register "script-fu-chalk-logo-alpha"
70
"Chalk scribbled logos"
71
"Manish Singh <msingh@uclink4.berkeley.edu>"
76
SF-DRAWABLE "Drawable" 0
77
SF-COLOR _"Background color" '(0 0 0))
76
_"Create a chalk drawing effect for the selected region (or alpha)"
77
"Manish Singh <msingh@uclink4.berkeley.edu>"
82
SF-DRAWABLE "Drawable" 0
83
SF-COLOR _"Background color" "black"
79
86
(script-fu-menu-register "script-fu-chalk-logo-alpha"
80
_"<Image>/Script-Fu/Alpha to Logo")
87
"<Image>/Filters/Alpha to Logo")
83
90
(define (script-fu-chalk-logo text
88
(let* ((img (car (gimp-image-new 256 256 RGB)))
90
(text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font))))
96
(img (car (gimp-image-new 256 256 RGB)))
98
(text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font)))
92
101
(gimp-context-push)
94
103
(gimp-image-undo-disable img)
95
(gimp-drawable-set-name text-layer text)
96
104
(gimp-context-set-foreground chalk-color)
97
(gimp-layer-set-preserve-trans text-layer TRUE)
105
(gimp-layer-set-lock-alpha text-layer TRUE)
98
106
(gimp-edit-fill text-layer FOREGROUND-FILL)
99
107
(apply-chalk-logo-effect img text-layer bg-color)
100
108
(gimp-image-undo-enable img)
101
109
(gimp-display-new img)
105
115
(script-fu-register "script-fu-chalk-logo"
107
"Chalk scribbled logos"
108
"Manish Singh <msingh@uclink4.berkeley.edu>"
112
SF-STRING _"Text" "CHALK"
113
SF-ADJUSTMENT _"Font size (pixels)" '(150 2 1000 1 10 0 1)
114
SF-FONT _"Font" "Cooper"
115
SF-COLOR _"Background color" '(0 0 0)
116
SF-COLOR _"Chalk color" '(255 255 255))
117
_"Create a logo resembling chalk scribbled on a blackboard"
118
"Manish Singh <msingh@uclink4.berkeley.edu>"
122
SF-STRING _"Text" "CHALK"
123
SF-ADJUSTMENT _"Font size (pixels)" '(150 2 1000 1 10 0 1)
124
SF-FONT _"Font" "Cooper"
125
SF-COLOR _"Background color" "black"
126
SF-COLOR _"Chalk color" "white"
118
129
(script-fu-menu-register "script-fu-chalk-logo"
119
_"<Toolbox>/Xtns/Script-Fu/Logos")
130
"<Toolbox>/Xtns/Logos")