Jump to content
smadell

Create & Edit Masks with Red Overlays

Recommended Posts

I am attaching a set of macros that allow the creation and editing of layer masks using a red overlay to assist in the process.

*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *

Creating masks in Affinity Photo is fairly easy. Either create a new Mask layer and paint on it, or use the Selection tools to select the appropriate area and then create the mask to incorporate the selection.

The absence of a red overlay when creating an initial mask can be overcome by using the Quick Mask tool, which allows the user to create a selection with the visual aid of a red overlay. Once the Quick Mask view has done its thing, (i) turn the Quick Mask off; and (ii) create the new mask layer.

Editing an existing mask is less straightforward. In order to edit a mask, you can paint in black, white, or grey while the mask layer is selected. Or, you can look at the mask in "isolation mode" to do your painting. In the first case, you don't get any type of red overlay to indicate what's masked and what's not; in the second case, you can't see the image being masked in order to tell where your mask needs editing.

Up until now, there has not been a good workaround. This set me thinking...

*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *

I am attaching a set of macros called Create/Edit Masks with Red Overlay. This is a set of 4 macros inside a macro category (and, therefore, import it through the Library panel).
The first two are for creating masks utilizing a red overlay. They are an alternative to using Quick Mask to create a selection and then use that selection to create a mask.

More importantly, however, the last two macros are for editing an existing mask with the benefit of a red overlay, being able to visualize the image being masked underneath.
[Note: these macros will not create, and will not adequately edit, vector based masks. They are exclusively for use on pixel based masks.]

Here are step by step directions for using the macros. I will use a photo of the USS Midway in my examples.

Original.thumb.jpg.85086e401cc000e8950886f361a2bd0d.jpg

1) Create Mask with Red Overlay - Set Up

Click on the first macro. This will create an empty mask layer (one which starts entirely black) embedded in a group. The various other layers in the group provide the red overlay - leave them alone. Paint with white or black (just as you would with the Quick Mask) in order to reveal or conceal areas of the underlying photo. The image below shows a mask with the body of the ship painted in white, and the rest of the mask black.

1796154502_1)CreateMask-SetUp.thumb.jpg.139ccb6a6ce31d2a5ccbefff58951103.jpg

2) Create Mask with Red Overlay - Finalize

Once you have created the mask as you might like it, click the second macro. This will place the newly created mask at the top of the layer stack, and it will be named "Mask - Drag to Desired Position." Obviously, you should position the new mask as you would like. The image below shows the result of the second macro, before the mask is repositioned.

122294638_2)CreateMask-Finalize.thumb.jpg.82eb0d0d59ae76c2dc69d8f9e8b5edd3.jpg

3) Edit Mask with Red Overlay - Set Up

Here's where the fun starts. You need to have a mask that you want to edit, and it needs to be selected. The mask should be a child of the pixel or image layer, and should not be further nested. (In other words, it should be a child of the image, but not a grandchild.) Click on the third macro. Your selected macro will be hidden and a copy of it will be placed into a group that sits above the appropriate image. The macro copy is named "TemporaryMaskForEditing." Edit that mask using black or white paint, just as you would any other mask. The difference here is that all this is constructed to allow you to see the photo while you are editing the mask. Just as in the Quick Mask setup, the white portions of the mask will reveal the photo below normally but the black portions of the mask will also show the photo, but covered with a red overlay.

The image below is the immediate result of clicking the third macro.

389434218_3a)EditMask-SetUp.thumb.jpg.28fa384f994445f9a32bc574732916ad.jpg

And, the next image shows an edited mask after using black and white paint on the mask layer.

9518713_3b)EditMask-SetUp.thumb.jpg.0a078de8ba71faac44eaaef76b700f6c.jpg

4) Edit Mask with Red Overlay - Finalize

Click on the fourth macro with the edited mask selected. The edited mask will be placed as a child in the photo, the old mask will still be there but remains invisible, and all the other stuff is deleted. The image below shows the result of the 4th macro.

2081011905_4)EditMask-Finalize.thumb.jpg.9c3d56d735885d2907036af35ce69a5e.jpg

*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *

No guarantees are made, and there are certainly some scenarios where this might not work. But, if it fulfills a need for you, it's yours.

Create:Edit Masks with Red Overlay.afmacros

Share this post


Link to post
Share on other sites

Hilltop...

Without going too deep into the weeds, creating and editing the masks are done outside of the original photo, and don't actually mask the photo itself while you're working; they mask the red overlay layers. Each portion (the 2 create and the 2 edit macros) come in two steps, each; the first is to set up the mask for creating (or editing) and the second is to put it into position. (i.e., click step 1 to set up a mask, then click step 2 once you've completed it; click step 3 if you want to edit a mask, then click step 4 once you've finished your editing.)

I guess the take-home message is that it's not necessary to look at the structure too carefully; just use the masks as if they were in their traditional place and form.

Share this post


Link to post
Share on other sites

 

14 hours ago, smadell said:

I made 2 little videos, one for Creating a New Mask and the second for Editing an Existing Mask. Sometimes watching the process helps it make more sense.

@smadell  That made it clear. Thank you for the video tut!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.