-
Notifications
You must be signed in to change notification settings - Fork 0
/
flatten-and-save-all.scm
34 lines (28 loc) · 999 Bytes
/
flatten-and-save-all.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(define (script-fu-flatten-and-save-all)
(define (for-each list func)
(let loop ((rest list))
(unless (null? rest)
(func (car rest))
(loop (cdr rest))
)
)
)
(for-each (vector->list (cadr (gimp-image-list))) (lambda (image)
(let (
(mergedLayer (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)))
(filename (string-append (list-ref (gimp-image-get-name image) 0) ".png"))
)
(file-png-save-defaults RUN-NONINTERACTIVE image mergedLayer filename filename)
)
))
)
(script-fu-register "script-fu-flatten-and-save-all"
_"Flatten and save all"
_"Flatten all opened images and save it as a png"
""
""
""
"*"
)
(script-fu-menu-register "script-fu-flatten-and-save-all"
"<Image>/Tools/")