I am trying to write a script in GIMP that will load a PNG file and save it again with maximum compression (I also plan to add other processing steps). However, the following script 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 example, the translucent pixels in jQuery icons seem completely transparent, making everything an alias.
How can this be fixed?
source share