1
; The GIMP -- an image manipulation program
2
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
; This program is free software; you can redistribute it and/or modify
5
; it under the terms of the GNU General Public License as published by
6
; the Free Software Foundation; either version 2 of the License, or
7
; (at your option) any later version.
9
; This program is distributed in the hope that it will be useful,
10
; but WITHOUT ANY WARRANTY; without even the implied warranty of
11
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
; GNU General Public License for more details.
14
; You should have received a copy of the GNU General Public License
15
; along with this program; if not, write to the Free Software
16
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
; Bovinated Logos v0.1 04/08/98
19
; by Brian McFee <keebler@wco.com>
20
; Creates Cow-spotted logs.. what else?
22
(define (apply-bovinated-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 RGBA-IMAGE
31
"Background" 100 NORMAL-MODE)))
32
(blur-layer (car (gimp-layer-new img
33
width height RGBA-IMAGE
34
"Blur" 100 NORMAL-MODE))))
38
(script-fu-util-image-resize-from-layer img logo-layer)
39
(gimp-image-add-layer img bg-layer 1)
40
(gimp-image-add-layer img blur-layer 1)
42
(gimp-selection-all img)
43
(gimp-context-set-background bg-color)
44
(gimp-edit-fill bg-layer BACKGROUND-FILL)
45
(gimp-selection-none img)
47
(gimp-layer-set-preserve-trans blur-layer TRUE)
48
(gimp-context-set-background '(255 255 255))
49
(gimp-selection-all img)
50
(gimp-edit-fill blur-layer BACKGROUND-FILL)
51
(gimp-edit-clear blur-layer)
52
(gimp-context-set-background '(191 191 191))
53
(gimp-selection-none img)
54
(gimp-layer-set-preserve-trans blur-layer FALSE)
55
(gimp-selection-layer-alpha logo-layer)
56
(gimp-edit-fill blur-layer BACKGROUND-FILL)
57
(plug-in-gauss-rle 1 img blur-layer 5.0 1 1)
58
(gimp-selection-none img)
59
(gimp-layer-set-preserve-trans logo-layer TRUE)
60
(gimp-selection-all img)
61
(plug-in-solid-noise 1 img logo-layer 0 0 23 1 spots-x spots-y)
62
(gimp-brightness-contrast logo-layer 0 127)
63
(gimp-selection-none img)
64
(gimp-layer-set-preserve-trans logo-layer FALSE)
65
(plug-in-bump-map 1 img logo-layer blur-layer
66
135 50 10 0 0 0 30 TRUE FALSE 0)
67
(gimp-layer-set-offsets blur-layer 5 5)
68
(gimp-invert blur-layer)
69
(gimp-layer-set-opacity blur-layer 50.0)
70
(gimp-image-set-active-layer img logo-layer)
74
(define (script-fu-bovinated-logo-alpha img
80
(gimp-image-undo-group-start img)
81
(apply-bovinated-logo-effect img logo-layer spots-x spots-y bg-color)
82
(gimp-image-undo-group-end img)
83
(gimp-displays-flush)))
85
(script-fu-register "script-fu-bovinated-logo-alpha"
87
"Makes Cow-spotted logos"
88
"Brian McFee <keebler@wco.com>"
93
SF-DRAWABLE "Drawable" 0
94
SF-ADJUSTMENT _"Spots density X" '(16 1 16 1 10 0 1)
95
SF-ADJUSTMENT _"Spots density Y" '(4 1 16 1 10 0 1)
96
SF-COLOR _"Background Color" '(255 255 255))
98
(script-fu-menu-register "script-fu-bovinated-logo-alpha"
99
_"<Image>/Script-Fu/Alpha to Logo")
102
(define (script-fu-bovinated-logo text
108
(let* ((img (car (gimp-image-new 256 256 RGB)))
110
(text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font))))
111
(gimp-image-undo-disable img)
112
(gimp-drawable-set-name text-layer text)
113
(apply-bovinated-logo-effect img text-layer spots-x spots-y bg-color)
114
(gimp-image-undo-enable img)
115
(gimp-display-new img)))
117
(script-fu-register "script-fu-bovinated-logo"
119
"Makes Cow-spotted logos"
120
"Brian McFee <keebler@wco.com>"
124
SF-STRING _"Text" "Fear the Cow"
125
SF-ADJUSTMENT _"Font size (pixels)" '(80 2 1000 1 10 0 1)
126
SF-FONT _"Font" "RoostHeavy"
127
SF-ADJUSTMENT _"Spots density X" '(16 1 16 1 10 0 1)
128
SF-ADJUSTMENT _"Spots density Y" '(4 1 16 1 10 0 1)
129
SF-COLOR _"Background color" '(255 255 255))
131
(script-fu-menu-register "script-fu-bovinated-logo"
132
_"<Toolbox>/Xtns/Script-Fu/Logos")