; ; woodgrain.scm - Good Wood Grain at last! ; ; ;;; -------------------------------------------------------------------- ;;; version 0.1 by Jeff Trefftzs ;;; - Initial relase ;;; version 0.2 Raymond Ostertag ;;; - ported to Gimp 2.0, changed menu entry ;;; ;;; -------------------------------------------------------------------- ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; Define the function: (define (script-fu-woodgrain inImage inLayer inDir inTight inFig inTurb inTile inGradient) (let* ( (seed (rand 999999999)) ; random seed for noise ) (gimp-image-undo-group-start inImage) ;; Start by filling with solid noise. (plug-in-solid-noise TRUE inImage inLayer inTile inTurb seed inFig (if (= inDir 0) 1.0 inTight) (if (= inDir 0) inTight 1.0)) ;; Now autostretch contrast (plug-in-c-astretch TRUE inImage inLayer) ;; And color it according to the gradient. (gimp-gradients-set-gradient inGradient) (plug-in-gradmap TRUE inImage inLayer) (gimp-image-set-active-layer inImage inLayer) (gimp-image-undo-group-end inImage) (gimp-displays-flush) ) ) (script-fu-register "script-fu-woodgrain" _"/Script-Fu/Render/Wood Grain..." "Creates a variety of wood grain textures. Uses solid noise and gradient mapping to get the proper effects." "Jeff Trefftzs" "Copyright 2001, Jeff Trefftzs" "July 4, 2001" "RGB* GRAY* INDEXED*" SF-IMAGE "The Image" 0 SF-DRAWABLE "The Layer" 0 SF-OPTION "Grain Direction" '("Horizontal" "Vertical") SF-ADJUSTMENT "Grain Tightness" '(6.5 0.1 16.0 .1 1 1 1) SF-ADJUSTMENT "Figure" '(3 1 8 1 1 0 1) SF-TOGGLE "Turbulent?" TRUE SF-TOGGLE "Tileable?" FALSE SF-GRADIENT "Gradient" "Wood_2" )