Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in running a simple unsharp mask batch processing script
#1
Hi all,

I'm trying to get this simple unsharp masking batch script to work. I have many .tif files, and I'd like to unsharp mask them in one go.

https://www.gimp.org/tutorials/Basic_Batch/

I've made the scm file, copied it over into the scripts directory. This is the scm file content:

Code:
(define (batch-unsharp-mask 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-file-save RUN-NONINTERACTIVE
                            image drawable filename filename)
            (gimp-image-delete image))
          (set! filelist (cdr filelist)))))

Next, I open command prompt, move to the folder with the images and run the following command:

Code:
gimp -b '(batch-unsharp-mask "*.tif" 5.0 0.5 0)' -b '(gimp-quit 0)'

Gimp does open up and all the tif files are opened one after another, but then gimp tries to load files named 5.0, 0.5 and 0. This results in an error message.

It says something like this:

Opening 'C:\Users\cxk340\for_gimp_processing\5.0' failed: No such file or directory

Any help would be appreciated. Thanks!
Reply


Messages In This Thread
Error in running a simple unsharp mask batch processing script - by ckolluru - 02-28-2020, 05:04 PM

Forum Jump: