Skip to content

Instantly share code, notes, and snippets.

@Polyrhythm
Created June 28, 2018 03:35
Show Gist options
  • Save Polyrhythm/d6be61488b325d23adabdd245983e078 to your computer and use it in GitHub Desktop.
Save Polyrhythm/d6be61488b325d23adabdd245983e078 to your computer and use it in GitHub Desktop.
(define (batch-monochrome pattern)
(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)))
(LUMINOSITY-FORMULA 1))
; do stuff here
(gimp-desaturate-full drawable LUMINOSITY-FORMULA)
(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