(define (batch-old-photo 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))))
(script-fu-old-photo
image
drawable
TRUE
0
TRUE
FALSE
FALSE)
(set! drawable (car (gimp-image-get-active-layer image)))
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
You can use this script by:
- save everything between the parentheses above in a file named ~/.gimp-2.2/scripts/batch-old-photo.scm
- copy the files you'd like to convert to sepia to a new directory. WARNING: this script modifies the files it's reading, so make sure you've made copies or your originals will be gone
- change into that directory and execute:
gimp -i -b '(batch-old-photo "*.jpg")' -b '(gimp-quit 0)'
For more on the basics of scripting The GIMP, see their tutorial.
Enjoy your new old-timey photos.