;;
;;   File        : gmic_shell.scm
;;               ( Scheme script for GIMP )
;; taken from    David Tschumperlé script
;; get gmic_gimp_qt plugin from www.gmic.eu


(define	(gmic-shell img drawable)

  ;; Start undo group.
  (gimp-image-undo-group-start img)

  (let* (
         (copy-layer (car (gimp-layer-copy drawable TRUE)))
        )

    ;; Add a copy of the layer to the image.
    (gimp-image-insert-layer img copy-layer 0 -1)

    ;;put your gmic commands in the following
;    (plug-in-gmic-qt 1 img drawable 1 0 "-v -99 uncomment & gmic command goes here")
    (plug-in-gmic-qt 1 img drawable 1 0 " -v -99 samj_Orbites 100,0,0,0,255,50,50,20,79,45,4,48,34,240,255,0,0,0,0,0,0,0,0")
    (plug-in-gmic-qt 1 img drawable 1 0 " -v -99 fx_highlight_bloom 90,124.44,52.53,65,38.2,0,50,50")

    (gimp-image-flatten img)
    
    )

  ;; Flush display.
  (gimp-displays-flush)

  ;; End undo group.
  (gimp-image-undo-group-end img)
  )

(script-fu-register "gmic-shell"
                    _"<Image>/Filters/G'MIC shell..."
                    ""
                    ""
                    ""
                    "2017"
                    "*"
                    SF-IMAGE		"Image"		1
                    SF-DRAWABLE         "Drawable"      1
                    )
