Quoting jeremy jozwik <jerjoz.for...@gmail.com>:

> hello list, just added my self so i hope this is an active list.
>
> im am attempting to batch compress OSM tile images. they are of png
> format, otherwise i would have used cjpeg.
> anyhow the script need only open the images in a folder and save them
> out with a different compression level [9]
>
> after reading the [1] batch mode page i have assembled this format:
> :
> :
>            (let* ((filename (car filelist))
>                   (image (car (gimp-file-load RUN-NONINTERACTIVE
>                                               filename filename)))
>              (gimp-file-png-save RUN-NONINTERACTIVE image drawable
> filename filename))
> :
> :

You need to define 'drawable'. Basically, you omitted a line from the  
script in the tutorial.

Also, the function to save a PNG file is 'file-png-save', or  
'file-png-save2' (not 'gimp-file-png-save'), and has several  
additional parameters that need to be specified if you are to change  
the compression. Use the PDB Browser under the Help Menu for more  
information on these parameters.

Try substituting the following for the 'gimp-file-save-png' line in  
your script:

     (file-png-save RUN-NONINTERACTIVE
                    image
                    drawable
                    filename
                    filename
                    FALSE  ; interlace (mostly for Web usage)
                    9      ; compression (0-9)
                    FALSE  ; bkgd (mostly for Web usage)
                    FALSE  ; gama (may be desirable for Macs targets)
                    FALSE  ; offs (useful for page layout targets)
                    FALSE  ; phys (useful for printing targets)
                    FALSE) ; time


> and run:
> $ gimp -i -b '(png-compress "*.png" 9)' -b '(gimp-quit 0)'

Hopefully you are not using Windows when you run this.


_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply via email to