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

1 Answer 1

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.

2
  • Thanks for your help. I noticed though that the files can be much lighter. With tinypng.com the compression is much higher. Are there any ways / programs to do this in the console on Linux?
    – dez
    Commented Jan 16, 2021 at 19:11
  • As it's usual to use imagemagick to do batch image processing on Linux you could try there, and the help does mention some non-ImageMagick png compression tools: legacy.imagemagick.org/Usage/formats/#png_non-im
    – paynekj
    Commented Jan 20, 2021 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .