0

I created the scripts from Using Gimp to batch convert images to another format in Windows tip made by @forrest-voight. Can anyone tell me how I can add options to this script so that the maximum compression (9) for each file is applied immediately ?

script . scm :

(define (myconvert in_filename out_filename)
    (let* (
            (image (car (gimp-file-load RUN-NONINTERACTIVE in_filename in_filename)))
            (drawable (car (gimp-image-get-active-layer image)))
        )
        (gimp-file-save RUN-NONINTERACTIVE image drawable out_filename out_filename)
        (gimp-image-delete image)
    )
)

command in terminnal:

for A in * ; do gimp -i -b "(myconvert \"$A\" \"$A.jpg\")" -b '(gimp-quit 0)' ; done
dez
  • 1

2 Answers2

0

Assuming you are trying to export as PNG, use file-png-save or file-png-save2 instead of gimp-file-save obviously you will have to set all the parameters accordingly.

paynekj
  • 116
0

@dez, about your comment, you can install pngquant (on Fedora: sudo dnf install pngquant), to achieve the same compression level as tinypng.com, to compress transparent pngs. Check here and its GitHub repository.