5

I just manually edited 200+ .PDF files in gimp and I would like to batch export all of them at once (in .PDF) instead of exporting one by one.

I have the plugin-registry installed, but I'm not sure if I can take advantage of it in this case.

I think what I need is a script / console command, but I know nothing about Python.

Thanks for your help.

asked Oct 10, 2014 at 4:06
3
  • I am having the same issue. I need to open a bunch of files, then export all of them. Commented Jun 18, 2015 at 20:43
  • This question is similar to: Save as on multiple files at once (GIMP). If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Mar 21, 2025 at 21:19
  • gitlab.gnome.org/GNOME/gimp/-/issues/11368 suggests this. Commented Mar 21, 2025 at 21:20

2 Answers 2

2

I'm having the same problem. My solution was:

  1. copy images to subdirectory
  2. open all copied images and edit them how you want.
  3. use the saveALL.scm script provided below (i can't remember where i found it). this script will overwrite opened files, but will save your edits on all opened images.
  4. if you're like me and you want to the edited output file to be a different format, follow up with ImageMagic and convert all files in the subdirectory using the mogrify function.

    ; 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" 
     "" 
     ) 
    
answered May 1, 2016 at 20:50
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much! This worked for me on MacOS 10.10.5 with GIMP 2.8.22.
0

According to @bishopia, the following script implements exporting all layers instead of only active one.

(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" 
 "" 
 ) 
answered Jun 11, 2024 at 15:19

1 Comment

Is this an answer, a follow-up question, or a 'thank you' to the person who answered previously? Please clarify what you mean. Thanks.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.