1

I have two layers, Layer A and Layer B, both of them have transparent areas. I need to merge A into B so that the destination has the non-transparent pixels of A and transparent pixels where the same layer A has transparent pixels.

In other words, I want to draw my layer A into B but make pixels in B that correspond to transparent pixels of A also transparent. And I cannot select transparent areas by hand and then delete the colors inside the selection because the image is a drawing (like my avatar) and is too complex.

3

There are two ways to make one layer use another's transparency in Photoshop. The easiest way is to use clipping masks. A clipping mask makes exactly that: make the layer use transparency of the layer beneath it. This is an example of two layers, a blue one over a red one (as you can see from the layer panel), where the red one has a completely opaque half and 50 % transparent half:

Blue layer over red one

When you turn on the clipping mask (e.g. from the Layer menu), it clips the blue rectangle first to the shape of the red rectangle, and also gives the right half the 50 % transparency, as with the red rectangle.

Note however that the semi-transparent blue rectangle does not show the semi-transparent red rectangle beneath it (it's light blue, not light purple). The rectangles' pixels are combined in 100 % opacity, and only after that given the transparency of the clipping mask's base layer. This can create unintuitive results especially when using other transparency modes, e.g. Multiply.

Blue layer over red one with a clipping mask turned on

The second way is to use normal masks. The one difference is that with separate masks the layers are blended with each other, now creating a bit darker, purple shade (50 % red + 50 % blue). It also enables you to edit the masks now separately.

enter image description here

There are at least two ways to duplicate one layer's transparency as the another one's mask. The first one is to load the first layer's transparency to a selection and then create a mask to another layer from it:

  1. Ctrl+click the layer to select its transparency
  2. select the layer above
  3. Layer menu > Layer Mask > Reveal Selection

The second one is to first create a mask from the first mask's transparency and then duplicate the mask.

  1. Layer menu > Layer Mask > From Transparency
  2. with Ctrl+Alt pressed, drag the newly created mask to the layer on top

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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