You are not logged in.

#1 2011-04-16 14:51:24

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

multithreaded gimp script

I came across this handy gimp script for batch processing a dir of photos.  I'm wondering if it can be tweaked to use all of my quad core chip's cores?  The application below uses only 1:

Here is the gimp script:

$ cat ~/.gimp-2.6/scripts/auto-fix.scm 
  (define (batch-auto-fix pattern  
                radius  
                amount  
                threshold)  
  (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))))  
       (plug-in-unsharp-mask RUN-NONINTERACTIVE  
                  image drawable radius amount threshold)  
       (gimp-levels-stretch drawable)  
       (gimp-file-save RUN-NONINTERACTIVE  
               image drawable filename filename)  
       (gimp-image-delete image))  
      (set! filelist (cdr filelist)))))

Here is how I am calling it from bash:

$ gimp -i -b '(batch-auto-fix "*.JPG" 5.0 0.5 0)' -b '(gimp-quit 0)'

Thanks!

Last edited by graysky (2011-04-16 14:51:37)

Offline

#2 2011-04-17 06:53:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: multithreaded gimp script

Is poor-man's-multithreading [1] an option?


[1] You run n scripts, each dealing with 1/n of the files that need to be processed.

Offline

Board footer

Powered by FluxBB