Last active
April 15, 2022 12:47
-
-
Save patrickward/7804465 to your computer and use it in GitHub Desktop.
Batching the selective blur filter in Gimp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Batch processes all files within the current directory | |
| ;; by running a selective blur on each image and then saving them | |
| ;; WARNING: edits the original file. Run this on copies of the original images. | |
| ;; | |
| ;; Save the script below in the local gimp scripts directory | |
| ;; (e.g. ~/.gimp-2.8/scripts/batch-selective-blur.scm) | |
| ;; | |
| ;; Example execution: | |
| ;; gimp -i -b '(batch-selective-blur "*.jpg" 6.0 31)' -b '(gimp-quit 0)' | |
| ;; | |
| (define (batch-selective-blur pattern | |
| radius | |
| maxdelta) | |
| (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)))) | |
| (plug-in-sel-gauss RUN-NONINTERACTIVE | |
| image | |
| drawable | |
| radius | |
| maxdelta) | |
| (gimp-file-save RUN-NONINTERACTIVE | |
| image | |
| drawable | |
| filename | |
| filename) | |
| (gimp-image-delete image)) | |
| (set! filelist (cdr filelist))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, how to put in the file list?