;;; Plugin  : crystalize
;;; Author  : Rod Detmer
;;; Date    : December 2015
;;; Revision: v-01
;;; 					
;;; Version : v-01
;;; Latest version at: http://www.gimpchat.com
;;; Required : Gimp 2.8 or later
;;;
;;; Description: 
;;; Creates a crystalize effect on a user created selected layer
;;; -----------------------------------------------------------------------------
;;; Change Log:
;;; Version-1.0
;;;
; Information can be found at http://www.gimpchat.com
;
; License: GPLv3
; 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 3 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.
;
; To view a copy of the GNU General Public License
; visit: http://www.gnu.org/licenses/gpl.html


(define (script-fu-crystalize_RD image drawable blur spread)
(gimp-image-undo-group-start image)
  (gimp-context-push)
  
  ;effects
(plug-in-spread RUN-NONINTERACTIVE image drawable spread spread)
(plug-in-gauss RUN-NONINTERACTIVE image drawable blur blur 1)  
  
  (gimp-context-pop)
(gimp-image-undo-group-end image)
  (gimp-displays-flush image)  
)
    ;register menu location and information	

(script-fu-register
 "script-fu-crystalize_RD"
 "<Image>/Rod/Artistic/crystalize"
 "creates a crystalize effect from an existing layer script-fu-crystalize_RD.scm. Works best on channel layers."
 "Rod Detmer"
 "Rod Detmer"
 "December 2015" 
 "RGB* GRAY*"
 SF-IMAGE       "The Image"     0
 SF-DRAWABLE    "The Drawable"  0
 SF-ADJUSTMENT  "Blur"        '(4 1 10000 1 10 0 SF-SLIDER) 
 SF-ADJUSTMENT  "Spread"      '(20 1 200 1 10 0 SF-SLIDER)
) 