From 39e46961a93021a0f6116935b3abfdf5d441ba8e Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 7 Sep 2015 20:17:22 +0100 Subject: [PATCH] Added gimp-script for adding shadow to screenshots. --- batch-drop-shadow.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 batch-drop-shadow.scm diff --git a/batch-drop-shadow.scm b/batch-drop-shadow.scm new file mode 100644 index 0000000..6aaa637 --- /dev/null +++ b/batch-drop-shadow.scm @@ -0,0 +1,26 @@ + ; Based on script by Michiel Roos, found on: + ; http://www.typofree.org/article/archive/2009/january/title/create-a-drop-shadow-folder-action/ + ; + ; Place the script in your gimp scripts folder (eg. ~/.gimp-2.8/scripts) go to the + ; folder with images you wish to add shadow to and execute like this: + ; gimp --no-data -i -b '(batch-drop-shadow "*.png" 8 8 10)' -b '(gimp-quit 0)' + ; + + (define (batch-drop-shadow pattern + offsetx + offsety + radius) + (let* ((filelist (cadr (file-glob pattern 1)))) + (while (not (null? filelist)) + (let* ((filename (car filelist)) + (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) + (drawable (car (gimp-image-get-active-layer image)))) + (script-fu-drop-shadow image drawable offsetx offsety radius '(0 0 0) 80.0 TRUE) + (set! drawable (car (gimp-image-merge-visible-layers image 0))) + (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) + (gimp-image-delete image) + ) + (set! filelist (cdr filelist)) + ) + ) + )