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
; Alien Glow themed bullets for web pages
5
5
; Copyright (c) 1997 Adrian Likins
6
; aklikins@eos.ncsu.edu
6
; aklikins@eos.ncsu.edu
8
8
; This program is free software; you can redistribute it and/or modify
9
9
; it under the terms of the GNU General Public License as published by
10
10
; the Free Software Foundation; either version 2 of the License, or
11
11
; (at your option) any later version.
13
13
; This program is distributed in the hope that it will be useful,
14
14
; but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
; GNU General Public License for more details.
18
18
; You should have received a copy of the GNU General Public License
19
19
; along with this program; if not, write to the Free Software
20
20
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
(define (center-ellipse img
31
(gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
35
22
(define (script-fu-alien-glow-bullet radius
39
(let* ((img (car (gimp-image-new radius radius RGB)))
41
(diameter (* radius 2))
42
(half-radius (/ radius 2))
43
(blend-start (+ half-radius (/ half-radius 2)))
44
(bullet-layer (car (gimp-layer-new img
45
diameter diameter RGBA-IMAGE
46
"Ruler" 100 NORMAL-MODE)))
47
(glow-layer (car (gimp-layer-new img diameter diameter RGBA-IMAGE
48
"ALien Glow" 100 NORMAL-MODE)))
49
(bg-layer (car (gimp-layer-new img diameter diameter RGB-IMAGE
50
"Background" 100 NORMAL-MODE))))
27
(define (center-ellipse img cx cy rx ry op aa feather frad)
28
(gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
34
(img (car (gimp-image-new radius radius RGB)))
36
(diameter (* radius 2))
37
(half-radius (/ radius 2))
38
(blend-start (+ half-radius (/ half-radius 2)))
39
(bullet-layer (car (gimp-layer-new img
40
diameter diameter RGBA-IMAGE
41
"Ruler" 100 NORMAL-MODE)))
42
(glow-layer (car (gimp-layer-new img diameter diameter RGBA-IMAGE
43
"ALien Glow" 100 NORMAL-MODE)))
44
(bg-layer (car (gimp-layer-new img diameter diameter RGB-IMAGE
45
"Background" 100 NORMAL-MODE)))
52
48
(gimp-context-push)
57
53
(gimp-image-add-layer img glow-layer -1)
58
54
(gimp-image-add-layer img bullet-layer -1)
60
; (gimp-layer-set-preserve-trans ruler-layer TRUE)
56
; (gimp-layer-set-lock-alpha ruler-layer TRUE)
61
57
(gimp-context-set-background bg-color)
62
58
(gimp-edit-fill bg-layer BACKGROUND-FILL)
63
59
(gimp-edit-clear glow-layer)
64
60
(gimp-edit-clear bullet-layer)
66
62
(center-ellipse img radius radius half-radius half-radius
67
CHANNEL-OP-REPLACE TRUE FALSE 0)
63
CHANNEL-OP-REPLACE TRUE FALSE 0)
69
65
; (gimp-rect-select img (/ height 2) (/ height 2) length height CHANNEL-OP-REPLACE FALSE 0)
70
66
(gimp-context-set-foreground '(90 90 90))
71
67
(gimp-context-set-background '(0 0 0))
73
69
(gimp-edit-blend bullet-layer FG-BG-RGB-MODE NORMAL-MODE
74
GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
76
blend-start blend-start
77
(+ half-radius radius) (+ half-radius radius))
70
GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
72
blend-start blend-start
73
(+ half-radius radius) (+ half-radius radius))
79
75
(gimp-context-set-foreground glow-color)
80
76
(gimp-selection-grow img border)
82
78
(gimp-edit-fill glow-layer FOREGROUND-FILL)
83
79
(gimp-selection-none img)
85
(plug-in-gauss-rle 1 img glow-layer 25 TRUE TRUE)
86
(plug-in-gauss-rle 1 img glow-layer 12 TRUE TRUE))
81
(plug-in-gauss-rle 1 img glow-layer 25 TRUE TRUE)
82
(plug-in-gauss-rle 1 img glow-layer 12 TRUE TRUE)
88
85
(if (= flatten TRUE)
89
(gimp-image-flatten img))
86
(gimp-image-flatten img)
90
88
(gimp-image-undo-enable img)
91
89
(gimp-display-new img)
95
95
(script-fu-register "script-fu-alien-glow-bullet"
97
"Create a Bullet with an Alien Glow theme for web pages"
102
SF-ADJUSTMENT _"Radius" '(16 1 100 1 10 0 1)
103
SF-COLOR _"Glow color" '(63 252 0)
104
SF-COLOR _"Background color" '(0 0 0)
105
SF-TOGGLE _"Flatten image" TRUE)
97
_"Create a bullet graphic with an eerie glow for web pages"
102
SF-ADJUSTMENT _"Radius" '(16 1 100 1 10 0 1)
103
SF-COLOR _"Glow color" '(63 252 0)
104
SF-COLOR _"Background color" "black"
105
SF-TOGGLE _"Flatten image" TRUE
107
108
(script-fu-menu-register "script-fu-alien-glow-bullet"
108
_"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow")
109
"<Toolbox>/Xtns/Web Page Themes/Alien Glow")