批量导出Gimp中所有打开的窗口

问题描述 投票:0回答:2

我刚刚在 gimp 中手动编辑了 200 多个 .PDF 文件,我想一次性批量导出所有这些文件(以 .PDF 格式),而不是逐一导出。

我安装了

plugin-registry
,但我不确定在这种情况下是否可以利用它。

我认为我需要的是一个脚本/控制台命令,但我对Python一无所知。

感谢您的帮助。

python gimp script-fu python-fu gimpfu
2个回答
2
投票

我也有同样的问题。我的解决方案是:

  1. 将图像复制到子目录
  2. 打开所有复制的图像并按照您想要的方式编辑它们。
  3. 使用下面提供的 saveALL.scm 脚本(我不记得在哪里找到它了)。该脚本将覆盖打开的文件,但会保存您对所有打开的图像的编辑。
  4. 如果您像我一样并且希望编辑后的输出文件为不同的格式,请使用 ImageMagic 并使用 mogrify 功能转换子目录中的所有文件。

    ; This program is free software
    ; you can redistribute it and/or modify 
    ; it under the terms of the GNU General Public 
    ; License as published by 
    ; the Free Software Foundation
    ; either version 2 of the License, or 
    ; (at your option) any later version. 
    ; 
    ; This program is distributed in the hope that it will be useful, 
    ; but WITHOUT ANY WARRANTY; without even the implied warranty of 
    ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    ; GNU General Public License for more details. 
    
    (define (script-fu-save-all-images) 
      (let* ((i (car (gimp-image-list))) 
             (image)) 
        (while (> i 0) 
          (set! image (vector-ref (cadr (gimp-image-list)) (- i 1))) 
          (gimp-file-save RUN-NONINTERACTIVE 
                          image 
                          (car (gimp-image-get-active-layer image)) 
                          (car (gimp-image-get-filename image)) 
                          (car (gimp-image-get-filename image))) 
          (gimp-image-clean-all image) 
          (set! i (- i 1))))) 
    
    (script-fu-register "script-fu-save-all-images" 
     "<Image>/File/Save ALL" 
     "Save all opened images" 
     "Saul Goode" 
     "Saul Goode" 
     "11/21/2006" 
     "" 
     ) 
    

0
投票

根据@bishopia,以下脚本实现导出所有图层,而不是仅导出活动图层。

(define (script-fu-save-all-images)
  (let* ((i (car (gimp-image-list))) 
         (image) 
         (merged-layer))
    (while (> i 0)
      (set! image (vector-ref (cadr (gimp-image-list)) (- i 1)))
      (set! merged-layer (car (gimp-image-merge-visible-layers image CLIP-TO-BOTTOM-LAYER)))
      (gimp-file-save RUN-NONINTERACTIVE 
                      image 
                      merged-layer 
                      (car (gimp-image-get-filename image)) 
                      (car (gimp-image-get-filename image)))
      (gimp-image-clean-all image)
      (set! i (- i 1)))))

(script-fu-register "script-fu-save-all-images" 
 "<Image>/File/Save/Save and Overwrite ALL" 
 "Save and Overwrite all opened images (CLIP-TO-BOTTOM-LAYER)" 
 "Saul Goode" 
 "Saul Goode" 
 "11/21/2006" 
 "" 
 ) 
© www.soinside.com 2019 - 2024. All rights reserved.