Created
May 5, 2013 08:45
-
-
Save hellocatfood/5520178 to your computer and use it in GitHub Desktop.
Do batch conversions using GIMP via the command line. Replace file types on line 2 and 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gimp -n -i -b - <<EOF | |
(let* ( (file's (cadr (file-glob "*.tiff" 1))) (filename "") (image 0) (layer 0) ) | |
(while (pair? file's) | |
(set! image (car (gimp-file-load RUN-NONINTERACTIVE (car file's) (car file's)))) | |
(set! layer (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))) | |
(set! filename (string-append (substring (car file's) 0 (- (string-length (car file's)) 4)) ".xcf")) | |
(gimp-file-save RUN-NONINTERACTIVE image layer filename filename) | |
(gimp-image-delete image) | |
(set! file's (cdr file's)) | |
) | |
(gimp-quit 0) | |
) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment