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

  1. (define (script-fu-slime-logo text size font)
  2.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  3.          (text-layer (car (gimp-text-fontname img -1 0 0 text 30 TRUE size PIXELS font)))
  4.          (width (car (gimp-drawable-width text-layer)))
  5.          (height (* (car (gimp-drawable-height text-layer)) 1.3))
  6.      (layer1 (car (gimp-layer-new img width height RGBA_IMAGE "Back" 100 NORMAL))))
  7.  
  8. ;; put the text white
  9.     (gimp-invert text-layer)
  10. ;; put the background black
  11.     (gimp-palette-set-background '(0 0 0))
  12.     (gimp-image-add-layer img layer1 1)
  13.     (gimp-edit-fill layer1 FG-IMAGE-FILL)
  14. ;; Resize the image
  15.     (gimp-image-resize img width height 0 0)
  16. ;; merge the text and the bg
  17.     (set! sboub (car (gimp-image-merge-down img text-layer 0)))
  18. ;; rotate the image from 90 degress
  19.     (plug-in-rotate 1 img sboub 1 TRUE)
  20. ;; put some wind
  21.     (plug-in-wind 1 img sboub 10 1 8 1 1)
  22. ;; rotate back
  23.     (plug-in-rotate 1 img sboub 3 TRUE)
  24. ;; wave it
  25.     (plug-in-waves 1 img sboub 4 0 50 0 0)
  26. ;; blur
  27.     (plug-in-gauss-iir 1 img sboub 5 1 1)
  28. ;; change the color to give the slime
  29.     (gimp-color-balance sboub 0 1 -100 0 -100)
  30.     (gimp-color-balance sboub 2 1 100 0 10)
  31. ;; display
  32.     (gimp-display-new img)))
  33.  
  34.  
  35. (script-fu-register "script-fu-slime-logo"
  36.                     "<Toolbox>/Xtns/Script-Fu/Logos/Slime"
  37.                     "Slime yourself..."
  38.  
  39.                     "Jean-Philippe Turcat (cmrjpt@soc.staffs.ac.uk)"
  40.                     "Jean-Philippe Turcat"
  41.                     "08/06/1999"
  42.                     ""
  43.                     SF-STRING "Text String" "Gimp"
  44.                     SF-ADJUSTMENT "Font Size (pixels)" '(72 2 1000 1 10 0 1)
  45.                     SF-FONT "Font" "-*-ComicsCarToon-*-r-*-*-24-*-*-*-p-*-*-*")
  46.