aboutsummaryrefslogtreecommitdiff
path: root/img-fu
diff options
context:
space:
mode:
Diffstat (limited to 'img-fu')
-rw-r--r--img-fu21
1 files changed, 21 insertions, 0 deletions
diff --git a/img-fu b/img-fu
new file mode 100644
index 0000000..17c1b6e
--- /dev/null
+++ b/img-fu
@@ -0,0 +1,21 @@
+(define (img-recode
+ srcfile
+ destfile
+ fmt
+ ckey)
+
+(let*
+ (
+ (image (car (file-img-load RUN-NONINTERACTIVE srcfile srcfile)))
+ (drawable (car (gimp-image-get-active-layer image)))
+ )
+
+ (file-img-save RUN-NONINTERACTIVE image drawable destfile destfile fmt ckey)
+)
+)
+
+(img-recode "samples/rgb.img" "samples/recoded-rgb565.img" "RGB565" "no")
+(img-recode "samples/rgb.img" "samples/recoded-rgba.img" "RGBA" "0x0F0")
+
+(gimp-quit 0)
+