I'm attempting to create a transparent stroke around the inner heart shape, which knocks out the "lungs" layer below to reveal the red bottom layer.

I seemed unable to create this as an actual stroke (which, in any case, would only reveal the "lung" shapes below it, not the red bottom layer), and my next attempt was to duplicate the heart, enlarge it and use it as a mask, but that also didn't help, as it's not an even outline of the heart.

Any ideas of the best way to do this? Thanks in advance.


  • I think I'm a little unclear on what the end result is going to be. Something like this?
    – JohnB
    May 20, 2013 at 15:38
  • Yes, that image is exactly what I'm going for! Except at the upper right, left and bottom tip of the heart in your version, you can actually see parts of stroke/outline itself, whereas I would prefer it to simply just display the red background... I think your mask method might work, except, as I wrote, if I simply recreate a larger version of the heart, as per the image, then the distance will not be uniform from around the edge of the heart to the edge of the stroke/mask, i.e. If you look at the top middle of the heart, the margin is much smaller than on the top corners. Do I make sense?! May 20, 2013 at 17:55
  • 2
    I think Photoshop is the wrong tool for what you are doing here. I think a vector illustration tools is perhaps going to be easier for this.
    – DA01
    May 20, 2013 at 19:17

5 Answers 5


The best method I found to do this is as follows:

  1. Create a stroke (any colour) of the appropriate size for the shape for which you wish to make the stroke transparent (although it will look like this, this will not be exactly what you are doing to achieve it.)

  2. Separate this stroke on to its own layer by right-clicking the shape's layer styles and selecting "Create Layers." Ignore the others for now.

  3. Now it's on its own layer, Cmd-click the stroke's shape in the layers panel, which will select the shape.

  4. Invert your selection, by holding Shift + Cmd + I, or Select > Inverse at the top.

  5. Select the layer below, which you will be masking with the separated stroke layer effect.

  6. Select "Add layer mask" from the bottom of the layers panel.

  7. Erase the stroke effect layer.

  8. To clean things up, if desired, merge this bottom layer with the top layer and all of the separated layer effects to create one layer.

enter image description here


A transparent stroke is probably not the best way to look at it. You'll need to use masks (in this case vector masks) to accomplish this.

General workflow is to Fill a layer with a color, create a path and go layer>vector mask. This will now control what of that layer is visible. With the mask selected, you'll notice a bunch of options in a dropdown at the top to combine/subtract/intersect/exclude. If you play around with these features, including combining multiple paths in the mask, you'll soon get what you are after.

  • Hi there, thank you for your help. I'm 90% there based on your advice, but it would be amazing if you might be able to address the concern I mentioned above when you have the time :) Thank you again. May 20, 2013 at 21:22
  • If you are using vectors to shape the mask, it will be easy to nudge the center v part of the heart down to adjust the margin at that point. I'm not sure how you've created it, but a heart is a pretty simple shape to trace with bezier curves - just create one side, duplicate and flip/mirror.
    – John
    May 21, 2013 at 15:18

I'm not sure of what you are trying to do.

For an even outline you probably want Object > Path > Offset Path instead of just duplicating and scaling the heart shape.

Edit: I just realised you have used Photoshop as a tag and my previous advice is for Illustrator.


I've always just copied the layer I want to have a stroke around (Ctrl-j), add a stroke of the ideal width to this new layer, rasterized layer style, then went into blending options, turned fill opacity to 0 and set the knockout to deep, then hit Ok and merged it into the layer the lungs would be on.


Here's how you can do it in Photoshop 2022

Create the stroke on a new layer - fill it with any color, doesn't matter.

Right click the stroke layer and open blending options. Set fill opacity to 0%

Set knockout to "deep" and the stroke will become transparent, knocking out anything beneath it. If you only need it to go through some things, group those things into a folder with the stroke layer and set knockout to "shallow" - it'll knockout everything in that group folder but nothing outside of it.

Your Answer

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

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