I'm trying to write a script in GIMP that will load a PNG file and save it again with maximum compression (I also plan on adding other processing steps). The following script, however, seems to destroy alpha information:
(define (process-png pattern)
(let* (
(filelist (cadr (file-glob pattern 1)))
)
(while (not (null? filelist))
(begin
(catch ()
(let* (
(filename (car filelist))
(image (car (file-png-load RUN-NONINTERACTIVE filename filename)))
)
(begin
(file-png-save2 RUN-NONINTERACTIVE
image (car (gimp-image-get-active-drawable image))
filename filename
0 9 0 0 0 0 0 0 0)
(gimp-image-delete image)
)
)
)
(set! filelist (cdr filelist))
)
)
)
)
For instance, the translucent pixels in JQuery icons all seem to become completely transparent, making everything aliased.
How can this be fixed?