2010-11-10 109 views
1

我采取了从我负的照片,我想反转的颜色在一个批处理,我有“不知何故”复制和粘贴这样的脚本:问题有关的简单GIMP脚本

(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))))) 

我试着按照教程,但失败,我认为在gimp-invert行有什么问题,但我不知道在哪里,任何人都可以帮忙?

谢谢!

编辑:仅供参考,我使用Ubuntu 10.10,再次感谢

回答

1

解决,我加了太多的参数gimp-levels-stretchgimp-invert,修改后的代码是如下:

(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))))) 
+0

不要忘了接受你自己的答案! – Johnsyweb 2010-11-13 04:47:07