Question
I have taken photos from my negative and I want to invert the color in a batch, I have "somehow" copy and paste a script like this:
(define (batch-negative 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))))
(gimp-invert RUN-NONINTERACTIVE
image drawable)
(gimp-levels-stretch RUN-NONINTERACTIVE
image drawable)
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
I try to follow the tutorial, but fails, I think there is something wrong at the line for gimp-invert
, but I don't know where, can anyone help?
Thanks!
Edit: FYI, I am using ubuntu 10.10, thanks again
Solution
solve, I added too many parameters for gimp-levels-stretch
and gimp-invert
, modified code is as below:
(define (batch-negative 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))))
(gimp-invert RUN-NONINTERACTIVE
image drawable)
(gimp-levels-stretch RUN-NONINTERACTIVE
image drawable)
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
OTHER TIPS
while i was browsing about the same problem i found your answer... but you delievered in your answer the exact same script again ;) so here is the fixed one, with the removed 2 parameters, which works fine:
(define (batch-negative 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))))
(gimp-invert drawable)
(gimp-levels-stretch drawable)
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow