0

Well I have an (set of) image(s) and I wish to create silhouettes out of those. Based on the alpha value of the image (alpha is either 0 or 1 no intermediate values).

The idea I had was to create three layers: a white background layer, a black foreground layer and a third top layer with the image.

Then for the top layer select the right image each time and would pick a blend/layer mode so that it "burns" the alpha from the top layer on the bottom layer. Then I could just load all images into the layers, set the blend modes and make them visible one by one.

Is this possible, or would I have to go through the lengthy process of creating a selection, and making a path from this selection and then using that path as object to fill in the "black" layer. (which requires many more steps and with around a 100 images to process I'm not looking forward to that).

So say I have this image (and/or with the white replaced by a transparent region):

enter image description here

And I wish to create the following:

enter image description here

5
  • Hi. Welcome to GDSE. TBH, I'm a bit lost with your verbal explanation. Can you please share an image showing what you are trying to do? We like pictures here! Thanks!
    – Billy Kerr
    Commented May 14, 2021 at 15:03
  • @BillyKerr just added an example of what I want to achieve.
    – paul23
    Commented May 14, 2021 at 15:05
  • Can't you just do an alpha to selection, and then fill with white? see example
    – Billy Kerr
    Commented May 14, 2021 at 15:21
  • Or even quicker, just lock the alpha channel, then fill with white see example.
    – Billy Kerr
    Commented May 14, 2021 at 15:37
  • @BillyKerr hmm I guess I could do that, though it would still require me to either prepare the images or show a few actions between each display. Instead of one click (make a layer visible) to show the different silhouettes. And switch between silhouette and originally image in real time. Especially the switching back, I don't like making a copy as that violates the one source of truth.
    – paul23
    Commented May 14, 2021 at 15:42

2 Answers 2

1

There are probably many ways you could do this. Here's one.

  1. Right click the image layer and do Alpha to Selection

  2. Create a new transparent layer, and make sure you select it in the layers panel

  3. Do Ctrl+, to fill with FG colour

enter image description here

Another possibility is to use Colors > Components > Extract component, select "Alpha" as the component. Do it on a copy of the image layer if you want to keep the original

enter image description here

0

You want something like this:

enter image description here

Your image is in Split mode in a group over a layer filled with the background color, and the group itself is over a layer filled with the silhouette color.

If you want to handle several images, you add them to the group. If you do not want to set every image to Split mode, put a layer group in Split mode where the image is, and add the images to is in Normal mode.

Edit #1: why the groups

Layer groups are not just a convenient way to keep layers together. They also act like parentheses do in algebra.

  • Without a group the layer stack above is evaluated bottom to top as (white overlaid_by black) split_by image and (white overlaid_by black) is just black
  • The presence of the group changes this order to white overlaid_by (black split_by image). Since black split_by image is black with a hole that silhouettes the image, the final result is the white showing through the image silhouette.

Edit #2: the Erase mode (instead of Split) works just as well, and could be more appropriate (these blend modes are new and ill-documented)

2
  • is the trick making a "group" - cause I tried this without grouping the layers and that didn't seem to work?
    – paul23
    Commented May 14, 2021 at 17:28
  • Yes, see edited answer
    – xenoid
    Commented May 14, 2021 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.