Batch application of filters in Gimp to make many old photos

I have bunch of files to which I want to apply the “Old Photos” GIMP filter.

For the uninitiated, Old Photos turns this:

into this:


This is a very simple script which will apply the Old Photos filter to every file matching the pattern you supply when you run GIMP. It has no “undo” function and it will save over the input files so be sure to make backups of the originals and only run this script on copies.

To call it you run:

gimp-2.6 -i -b "(many-old-photos \"*.jpg\")" -b "(gimp-quit 0)"

You can download make-many-old-photos.scm here or click here to view the code.

;
; many-old-photos
;
;
; Chris Speck (www.chrisspeck.com)
;
; This program calls the old-photo script, made by Chris Gutteridge, (and packaged with The GIMP 2.4+)
; and runs it on a set of files. Does not seem to run on Linux :-(
;
; WARNING! THIS WILL OVERWRITE THE ORIGINAL FILES, SO BACK UP YOUR ORIGINALS AND RUN THIS ON
; COPIES ONLY!!!
;
; This program could also be adapted to run any other command(s) or filter(s) across a set of files
;
; To run:
;  [WINDOWS]    gimp-2.6 -i -b "(many-old-photos \"*.jpg\")" -b "(gimp-quit 0)"
;
; this is the definition for OldPhoto with defaults
; (define (script-fu-old-photo inImage inLayer inDefocus inBorderSize inSepia inMottle inCopy)
;                                               TRUE        20          TRUE    TRUE    FALSE
;
(define (many-old-photos 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 20 TRUE TRUE FALSE)
            (set! drawable (car (gimp-image-flatten image)))
            (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
            (gimp-image-delete image))
(set! filelist (cdr filelist)))))

Leave a Reply

*

Contact Nixz Kerr