メニューから [フィルタ>すべてのレイヤーに対して処理] を選択
次のようなダイアログが出ます。リストから選んで実行してください。
処理を追加するときも anbt-proc-for-all-layers:proc-list に加えるだけなのでお手軽です。
;; anbt-proc-for-all-layers.scm
;; The MIT License
;;
;; Copyright (c) 2010 sonota
;;
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the "Software"), to deal
;; in the Software without restriction, including without limitation the rights
;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
;; copies of the Software, and to permit persons to whom the Software is
;; furnished to do so, subject to the following conditions:
;;
;; The above copyright notice and this permission notice shall be included in
;; all copies or substantial portions of the Software.
;;
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
;; THE SOFTWARE.
(define anbt-proc-for-all-layers:proc-list
'(
("不透明度を100に"
. (lambda (img layer) (gimp-layer-set-opacity layer 100)))
("階調の反転"
. (lambda (img layer) (gimp-invert layer)))
("アルファチャンネルを削除"
. (lambda (img layer) (gimp-layer-flatten layer)))
("レイヤーモードを「乗算」に"
. (lambda (img layer) (gimp-layer-set-mode layer MULTIPLY-MODE)))
("レイヤーをキャンバスに合わせる"
. (lambda (img layer) (gimp-layer-resize-to-image-size layer)))
))
(define (script-fu-anbt-proc-for-all-layers img proc-index)
(gimp-image-undo-group-start img)
(let ((layer-id-list
(vector->list (cadr (gimp-image-get-layers img))))
(proc
(eval (cdr (nth
proc-index
anbt-proc-for-all-layers:proc-list)))))
(for-each
(lambda (layer) (proc img layer))
layer-id-list))
(gimp-displays-flush)
(gimp-image-undo-group-end img))
(script-fu-register
"script-fu-anbt-proc-for-all-layers"
"<Image>/Filters/すべてのレイヤーに対して処理"
"すべてのレイヤーに対して処理"
"sonota"
"(c) 2010"
"2010-08-30"
"RGB*, GRAY*, INDEXED*"
SF-IMAGE "Image" 0
SF-OPTION "処理" (map car anbt-proc-for-all-layers:proc-list))
Gimp関連記事のもくじ