Thank you very much for the script. I will give it a try.
A knockout, in general terms, is a layer that 'makes' a hole in the beneath
layers allowing to show the background layer. Picture this: you've a
background layer with an image, a layer that covers the background layer
with a color and a third layer, above all, that will punch a hole in the
middle layer allowing the background layer to appear. More explicit here:
2007/1/8, Scott Bicknell <[EMAIL PROTECTED]>:
On Monday 08 January 2007 1:40 am, Jorge Antunes wrote:
> I'm new to Gimp and i'm trying to find a way to duplicate in
> gimp a procedure that I've used in Photoshop.
> In photoshop I use extensively the layer grouping because
> layer's advanced blending knockout options.
> I know that layer grouping is not possible in Gimp, but I also
> can´t find similar options to knockout blending.
> How can I, using Gimp, set a knockout layer?
> Best Regards,
> Jorge Antunes
You can achieve the same result using layer masks. Unfortunately,
there is not a simple built-in way of copying a layer mask to
multiple layers or of applying a layer mask to multiple layers.
There is a script-fu plugin that will do that. I don't know
where I got it. It doesn't seem to be in the Gimp's plugin
repository. So here it is:
; This program is free software; you can redistribute it and/or
; it under the terms of the GNU General Public License as
; the Free Software Foundation; either version 2 of the License,
; (at your option) any later version.
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
(define (script-fu-copy-mask-to-layers image drawable)
(define (visible-layers img)
(all-layers (gimp-image-get-layers img))
(i (car all-layers))
(set! all-layers (cadr all-layers))
(while (> i 0)
(set! tmp (car (gimp-drawable-get-visible (aref
all-layers (- i 1)))))
(if (= tmp TRUE)
(set! viewable (append viewable (cons (aref all-layers
(- i 1))))))
(set! i (- i 1)))
(active-layer (car (gimp-image-get-active-layer image)))
(set! layers (visible-layers image))
(set! source-layer (car (gimp-layer-new-from-drawable
(gimp-image-add-layer image source-layer -1)
(set! source-mask (car (gimp-layer-get-mask source-layer)))
(if (= source-mask -1)
(set! source-mask (car (gimp-layer-create-mask
(gimp-layer-add-mask source-layer source-mask)))
(while (car layers)
(if (= (car (gimp-layer-get-mask (car layers))) -1)
(if (= (car (gimp-drawable-has-alpha (car layers))) 1)
(set! mask (car (gimp-layer-add-mask (car layers)
(set! layers (cdr layers)))
(gimp-image-remove-layer image source-layer)
"Copy the mask from the current layer to all visible layers"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
Just copy that to a separate file, name it with a .scm extension
and place it in your Gimp script-fu directory. You can find it
on your image Window's Script-fu menu at the bottom.
It will copy a layer mask to all visible layers, replacing any
masks that already exist, so be careful. You can create a mask
that punches a hole in one layer and use this plugin to apply
the same mask to all the other layers of an image.
Linux User #246504
Gimp-user mailing list
Gimp-user mailing list