;;; Plugin  : Crayon Text - for Gimp-2.6.12
;;; Author  : Rod Detmer
;;; Date    : August 24th 2012
;;; Revision: 2.6
;;; 					
;;; Latest version at: http://www.gimpchat.com
;;; Required : Gimp 2.6
;;;
;;; Description: 
;;; Applies a crayolal text effect to your text layer
;;; -----------------------------------------------------------------------------
;;; Change Log:
;;; Version-1.0
;;; Version - 2.6
;;; re-written to work better with darker colors.
;;;
;;; License:
;;; 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.
;;; 
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

(define (script-fu-crayon-text-two image layer mycolor mymessiness)
  (gimp-image-undo-group-start image)
  (gimp-layer-resize-to-image-size layer)
  (plug-in-displace 1 image layer 5 4 0 0 layer layer 0) ;displace 1
  (plug-in-displace 1 image layer 4 5 0 0 layer layer 0) ;displace 2
  (plug-in-spread 1 image layer 2 2) ;spread
  (gimp-selection-layer-alpha layer)
  (gimp-selection-grow image 2)
  (gimp-context-set-foreground mycolor)
  (gimp-edit-bucket-fill layer 0 0 100 255 1 0 0)
  (gimp-selection-none image)
  (plug-in-spread 1 image layer 2 2) ;spread
  (plug-in-spread 1 image layer mymessiness mymessiness) ;spread
  (gimp-selection-layer-alpha layer)
  ;(plug-in-warp 1 image layer 10.00 layer mymessiness 0 90 0 layer 0 1 0 1 0 1 0);messiness adjustment
  (plug-in-hsv-noise 1 image layer 1 0 11 20)
  (gimp-selection-none image)
  (gimp-context-set-foreground '(0 0 0))
  (gimp-context-set-background '(255 255 255))
  (gimp-displays-flush image)
  (gimp-image-undo-group-end image)
)
(script-fu-register
 "script-fu-crayon-text-two"
 "<Image>/Script-Fu/Text Effects/Crayon Text Two"
 "Applies a crayolal text effect to your text layer"
 "Rod Detmer"
 "Rod Detmer"
 "August 2012" 
 "RGB* GRAY* INDEXED*"
 SF-IMAGE "The Image" 0
 SF-DRAWABLE "The Layer" 0
 SF-COLOR "Crayon Color (fg)" '(20 130 235)
 SF-ADJUSTMENT "Messyness" '(3 1 10 1 10 0 SF-SLIDER) 
)

