home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / Topware / gimp / gimp-setup-20001226.exe / Main / clothify.scm < prev    next >
Encoding:
GIMP Script-Fu Script  |  2000-12-27  |  2.0 KB  |  56 lines

  1. ; CLOTHIFY version 1.02
  2. ; Gives the current layer in the indicated image a cloth-like texture.
  3. ; Process invented by Zach Beane (Xath@irc.gimp.net)
  4. ;
  5. ; Tim Newsome <drz@froody.bloke.com> 4/11/97
  6.  
  7. (define (script-fu-clothify timg tdrawable bx by azimuth elevation depth)
  8.     (let* (
  9.         (width (car (gimp-drawable-width tdrawable)))
  10.         (height (car (gimp-drawable-height tdrawable)))
  11.         (img (car (gimp-image-new width height RGB)))
  12. ;        (layer-two (car (gimp-layer-new img width height RGB "Y Dots" 100 MULTIPLY)))
  13.         (layer-one (car (gimp-layer-new img width height RGB "X Dots" 100 NORMAL)))
  14.         (old-bg (car (gimp-palette-get-background))))
  15.  
  16.     (gimp-image-undo-disable img)
  17.     (gimp-palette-set-background '(255 255 255))
  18.     (gimp-edit-fill layer-one BG-IMAGE-FILL)
  19.     (gimp-image-add-layer img layer-one 0)
  20.  
  21.     (plug-in-noisify 1 img layer-one FALSE 0.7 0.7 0.7 0.7)
  22.  
  23.     (set! layer-two (car (gimp-layer-copy layer-one 0)))
  24.     (gimp-layer-set-mode layer-two MULTIPLY)
  25.     (gimp-image-add-layer img layer-two 0)
  26.  
  27.     (plug-in-gauss-rle 1 img layer-one bx TRUE FALSE)
  28.     (plug-in-gauss-rle 1 img layer-two by FALSE TRUE)
  29.     (gimp-image-flatten img)
  30.     (set! bump-layer (car (gimp-image-get-active-layer img)))
  31.  
  32.     (plug-in-c-astretch 1 img bump-layer)
  33.     (plug-in-noisify 1 img bump-layer FALSE 0.2 0.2 0.2 0.2)
  34.  
  35.     (plug-in-bump-map 1 img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)
  36.     (gimp-image-delete img)
  37.     (gimp-palette-set-background old-bg)
  38.     (gimp-displays-flush)
  39. ))
  40.  
  41.  
  42. (script-fu-register "script-fu-clothify"
  43.             _"<Image>/Script-Fu/Alchemy/Clothify..."
  44.             "Gives the current layer a cloth-like texture"
  45.             "Tim Newsome <drz@froody.bloke.com>"
  46.             "Tim Newsome"
  47.             "4/11/97"
  48.             "RGB* GRAY*"
  49.             SF-IMAGE "Input Image" 0
  50.             SF-DRAWABLE "Input Drawable" 0
  51.             SF-ADJUSTMENT _"Blur X" '(9 3 100 1 10 0 1)
  52.             SF-ADJUSTMENT _"Blur Y" '(9 3 100 1 10 0 1)
  53.             SF-ADJUSTMENT _"Azimuth" '(135 0 360 1 10 1 0)
  54.             SF-ADJUSTMENT _"Elevation" '(45 0 90 1 10 1 0)
  55.             SF-ADJUSTMENT _"Depth" '(3 1 50 1 10 0 1))
  56.