Let's say I have two layers with some black pixels on them:

enter image description here

What can I do with blending, masks, knockouts, etc, such that when these two black things overlap, they reveal the color underneath, like this?:

enter image description here

I accomplished the above with a jury-rigged technique of manually creating a white duplicate of one of the shapes and using a layer mask to reveal it in the right spot. What I'd like is a more streamlined way that doesn't need an additional pixel layer, and can keep the knockout effect as the two shapes are repositioned.

  • What's the nature of the layers? Pixel based? Shape Layers? Smart Objects? This is easy with shape/vector layers. Not so easy with pixel layers or smart objects. – Scott Aug 29 '17 at 19:38
  • @Scott - They're just two pixel layers. Shapes and vectors aren't options in my particular case. – bubbleking Aug 29 '17 at 19:42

This is a bit convoluted and won't easily translate to more complex artwork (i.e. anything other than solid black/white blocks of color), but it's the only way I can think to do this with pixel layers and have the effect "live" and update with any changes to the layers...

You can use the "Difference" blending mode on the top layer, which subtracts the color values of one layer from the other. The only problem being that blending with black produces no change; blending white with white however produces black...

If you can change the rectangles to white, set the top layer to "Difference" and invert the result (with an "Invert" adjustment layer), you can get close to the result you want:

enter image description here

Then if you want the background color to show through you can group the two rectangles, clip the invert adjustment layer to the group so that it doesn't affect the background, then set the group's blend mode to "Multiply":

enter image description here

If you can't change the black pixel layers to actually be white, you can just add a white color overlay to each of the black layers:

enter image description here

  • 1
    I selected this as the answer because it is closest to what I was asking for, in my opinion. I also came up with a similar method using clipping masks and locking a black and a white version of the same pixel-object together, but this solution is a little nicer, I think. – bubbleking Aug 30 '17 at 22:03

I'm betting there's a simpler way, but this way works without another layer and you could easily turn it into an action:

  • Step 1: Overlap two layers Step 1

  • Step 2: Ctrl/command-click the first layer in the layer panel to select its outline, then click the second layer. Press the 'add layer mask' button at the bottom of the layers panel. This hides anything but the A overlap from B. Step 2

  • Step 3: Repeat in reverse order. Ctrl/command-click the second layer, select the first layer, add layer mask. Now only the overlap is visible. We want to opposite though. Step 3

  • Step 4: Invert the layer masks by selecting each layer mask in the layers panel and pressing ctrl/command-I Step 4

You'll have to remove the layer masks and redo all the steps every time you move a layer, but it's actually relatively quick. Experiment with creating an action for it, perhaps? This technique works with more than two layers, as well.

  • 1
    This is a nice technique, and I didn't know about inverting layer masks like that! – bubbleking Aug 30 '17 at 21:57

Others have given answers here that will work in PS, however have you considered using Illustrator for this? It has a new feature called the Shaper Tool, which is used for making non-destructive combinations of shapes exactly like that.

I know you asked for Photoshop, but Illustrator makes such tasks super easy.

Here's an example of moving one of the shapes around inside a Shaper Group - with the overlap set to knock out.

enter image description here

  • 2
    Indeed. I was told by others this is easy in Illustrator. I've had "get comfortable with Illustrator" on my to-do list for well over a decade now, but still have yet to do it. ;) On the other hand, I've been using Photoshop for 20 years, so for this quick thing I needed to do, like usual, I had to make it work in PS. This is yet another reason for me to learn Illustrator, and is a welcome contribution. – bubbleking Aug 30 '17 at 22:01

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.