1
; The GIMP -- an image manipulation program
2
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
; Alien Glow themed bullets for web pages
5
; Copyright (c) 1997 Adrian Likins
6
; aklikins@eos.ncsu.edu
8
; This program is free software; you can redistribute it and/or modify
9
; it under the terms of the GNU General Public License as published by
10
; the Free Software Foundation; either version 2 of the License, or
11
; (at your option) any later version.
13
; This program is distributed in the hope that it will be useful,
14
; but WITHOUT ANY WARRANTY; without even the implied warranty of
15
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
; GNU General Public License for more details.
18
; You should have received a copy of the GNU General Public License
19
; along with this program; if not, write to the Free Software
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
(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))))
54
(gimp-image-undo-disable img)
55
(gimp-image-resize img diameter diameter 0 0)
56
(gimp-image-add-layer img bg-layer 1)
57
(gimp-image-add-layer img glow-layer -1)
58
(gimp-image-add-layer img bullet-layer -1)
60
; (gimp-layer-set-preserve-trans ruler-layer TRUE)
61
(gimp-context-set-background bg-color)
62
(gimp-edit-fill bg-layer BACKGROUND-FILL)
63
(gimp-edit-clear glow-layer)
64
(gimp-edit-clear bullet-layer)
66
(center-ellipse img radius radius half-radius half-radius
67
CHANNEL-OP-REPLACE TRUE FALSE 0)
69
; (gimp-rect-select img (/ height 2) (/ height 2) length height CHANNEL-OP-REPLACE FALSE 0)
70
(gimp-context-set-foreground '(90 90 90))
71
(gimp-context-set-background '(0 0 0))
73
(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))
79
(gimp-context-set-foreground glow-color)
80
(gimp-selection-grow img border)
81
(gimp-selection-feather img border)
82
(gimp-edit-fill glow-layer FOREGROUND-FILL)
83
(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))
89
(gimp-image-flatten img))
90
(gimp-image-undo-enable img)
91
(gimp-display-new img)
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)
107
(script-fu-menu-register "script-fu-alien-glow-bullet"
108
_"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Alien Glow")