convert bootmisc.mng +repage +adjoin -coalesce script_k_%02d.png |
identify -verbose bootmisc.mng |egrep -i 'scene|delay' |
Delay: 100x100 Scene: 0 of 4 Delay: 100x100 Scene: 1 of 4 Delay: 100x100 Scene: 2 of 4 Delay: 100x100 Scene: 3 of 4 |
(define (batch-set-alph pattern )
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* (
(filename (car filelist))
(image (car (gimp-file-load 1 ;; 1=RUN-NONINTERACTIVE
filename ;; file name
filename ;; raw-file name
)
)
)
(drawable (car (gimp-image-get-active-layer image)))
)
(plug-in-colortoalpha 1 ;; 1=RUN-NONINTERACTIVE
image ;; image object name
drawable ;; drawable layers
'(0 0 0) ;; Color to make alpha (black)
)
(gimp-file-save 1 ;; 1=RUN-NONINTERACTIVE
image ;; image object name
drawable ;; Drawable layer to save
filename ;; filename
filename ;; raw-filename
)
(gimp-image-delete image))
(set! filelist (cdr filelist))
)
)
)
|
gimp -i -b '(batch-set-alph "*.png" )' -b '(gimp-quit 0)' |
;;
;; 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)
)
)
|
gimp -i -b '(asseble_png_to_mng first.png second.png output.mng )' -b '(gimp-quit 0)' |