home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 February / PCWorld_2001-02_cd.bin / Software / Topware / gimp / gimp-setup-20001226.exe / Main / alien-glow-bullet.scm < prev    next >
Encoding:
Text File  |  2000-12-27  |  3.5 KB  |  89 lines

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