;;
;; Takes three files
;; First is opened,
;; Second is opened into first as a layer
;; Saves result as third (in animated mng format).
;;
;; SYNTAX: gimp -i -b '(asseble_png_to_mng "script_k_00.png" "script_k_01.png" "test.mng" )' -b '(gimp-quit 0)'
;;
;;
(define ( asseble_png_to_mng input_file1 input_file2 out_file )
(let* (
;;
;; Open input_file1 as image
;; Tested working.
;;
(image (car (gimp-file-load 1 ;; RUN-NONINTERACTIVE
input_file1 ;;
input_file1 ;;
)
)
)
(drawable (car (gimp-image-get-active-layer image)))
)
;;
;; Open input_file2 as a layer
;; Not working
;;
(set! ( LogoLayer (car (gimp-file-load-layer 1 ;; RUN-NONINTERACTIVE
image ;; destination image object
input_file2 ;; image to load in layer
)
)
)
)
;;
;; Add the layer to the image?
;; Not working
;;
(gimp-image-add-layer image ;; The image
LogoLayer ;; The layer
0 ;; The position
)
;;
;; Now save the file as an mng
;; Tested, Working
;;
(file-mng-save 1 ;; Interactive, non-interactive
image ;; Input image
drawable ;; Drawable to save
out_file ;; filename (The name of the file to save the image in)
out_file ;; raw-filename (The name of the file to save the image in)
0 ;; interlacing
0 ;; PNG deflate Compression Level
0.75 ;; JPEG quality factor (0.00 - 1.00)
0.00 ;; JPEG smoothing factor (0.00 - 1.00)
0 ;; (ANIMATED MNG) Loop infinitely
100 ;; (ANIMATED MNG) Default delay between frames in millisecond
2 ;; (ANIMATED MNG) Default chunks type (0 = PNG + Delta PNG; 1 = JNG + Delta PNG; 2 = All PNG; 3 = All JNG)
0 ;; (ANIMATED MNG) Default dispose type (0 = combine; 1 = replace)
0 ;; Write bKGD (background color) chunk
0 ;; Write gAMA (gamma) chunk
0 ;; Write pHYs (image resolution) chunk
0 ;; Write tIME (creation time) chunk
)
(gimp-image-delete image)
)
)
|