Jump to content
You must now use your email address to sign in [click for more info] ×

Luminosity Masks


smadell

Recommended Posts

In response to a post I made last May, MJSfoto1956 suggested the use of Blend Options as an alternative to more traditional luminosity masks. It turns out that the use of the Blend Options panel, combined with a little math, makes luminosity based selections quite effective. The trouble is that the method is cumbersome if you do them from scratch each time.

What I have created is a series of Macros that automates the process. The attached afmacros file contains macros for creating Luminosity Selections in their usual and anticipated forms: Lights 1 through Lights 4, Darks 1 through Darks 4, and Midtones 1 through Midtones 4.

Notes:

1) Each action will select a luminosity-based portion of the selected layer.
2) NO additional channels are created, so files don’t become bloated.
3) Once the selection is made, it can be used for an adjustment layer, a mask, a live filter, etc. It can be deselected (like any selection). It can be replaced by using a different selection (e.g., click on Lights 2 to replace the selection made by Lights 1).

Caveats:

4) You must have a Pixel layer or an Image layer selected for the macros to work properly. If you have any other type of layer selected, or if you have NO layer selected, the results you get will be wrong.
5) The macros will undo any Blend Options you may have set on the selected layer.
6) I am one person with one computer. Obviously, I have not tested these macros in every possible situation. Use them if you like them. No guarantees are made.
7) However, if you like them, they are yours. They are my way of saying “thank you” to the Forum for helping me learn a wonderful piece of software!

Luminosity Selections.afmacros.zip

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

Puffin...

 

You can't open an .afmacros file by double-clicking on it (or, I presume, by choosing Open... from within Affinity Photo). Rather, go to the Library panel, click on the "hamburger" menu on the top (the VERY top, not the menu that exists in each Category) and choose Import Macros... Open the file from the dialog box, and Affinity should import the macros into a new category in the Library panel.

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

Thank you kindly for taking the effort to create Macros to automate the creation of Luminosity Masks. As soon as Affinity Photo 1.5 comes out of Beta, I intend to start using them.


 


I have a more general question regarding your effort. Each action will only do one portion of the selected layer, thereby saving space. I’m well-aware of the bloated files when one creates all the masks (or a large part of them). While in the end you can erase the unneeded (or all) channels, it’s a pain. 


 


However, could you consider expanding your options to include All, All Lights, All Darks and All Midtones? The reason for this suggestion is that when one first starts on an image, how does one figure out which mask to use? By having all of them available, at least at the beginning, one could determine visually which candidate masks to use. Unless you’ve come up with another method to do just that. I would like to know about it, if you have...


 


Of course I could just go through all 12 Macros and open them myself, but I thought there might be an easier way.


 


Again, thanks for your gift.


Link to comment
Share on other sites

WeiPhotoArts…

As you know, luminosity masks are essentially greyscale representations of the layer itself. In a “lights” luminosity mask, any pixel that is 100% luminous (e.g., completely white) will be unaffected by the mask. Conversely, a pixel which is 0% luminous (e.g., black) will be completely masked. Everything in-between is partially masked - the darker pixels are masked more than the lighter pixels. The opposite is true for a “darks” luminosity mask, and "midtone" masks favor the middle-grey level of luminosity.

The difference between, say, Lights 1 and Lights 2 is simply how skewed the selection is toward the lights. In a Lights 1 selection, for instance, 50% grey would be 50% selected. In a Lights 2 selection, 50% grey is only 25% selected (50% x 50%). In Lights 3, 50% grey is 12.5% selected (50% x 50% x 50%). And so on.

As an exercise, open a photo and make 1 or 2 duplicates of the background layer. Now, apply Lights 1 to one of the layers and make a mask of it. Select a different layer, select Lights 2 and make a mask of that. Now, Option-click on the masks one at a time. You will see greyscale representations of the Luminosity Selections/Masks.

Of course, you could automate that process with a macro, but that would create lots of extra layers and masks that you would then have to delete. I think this adds confusion, and doesn’t really give you any practical information.

In my experience, using luminosity masks is a bit of a trial-and-error process. If Lights 1 doesn’t work, try Lights 2, etc. With practice, you get better at estimating which one to use. But you’ll always be in a situation where you may need to choose a different selection. For me, at least, seeing the greyscale masks ahead of time doesn't really help me choose.

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

MBd...

 

Here's a question for you. Since the Luminosity macros I created are based on Blend Options settings, a variation on them could accomplish what you're suggesting (and what WeiPhotoArts might be looking for). Instead of using a macro to create a luminosity selection (as the current macros do), imagine a macro that would simply set the Blend Options of a layer to a curve that corresponds to Lights 1, Lights 2, etc. This wouldn't really do any good on a Pixel layer, but it would be nice for an Adjustment layer.

 

For instance, if I apply a Curves adjustment to my photo, I could create luminosity macros that would set Blend Options for the Curves layer itself. Sequentially choosing different macros would give me a Live Preview of how that luminosity mask would affect the adjustment. Is it worth it? Would it confuse too many people?

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

Don't really know what you mean

 

Blend options work for blending pixel layer as well as adjustment layers and love filter layers....

 

Just use the underlying composition range.

 

I would not really create a macro for that in first place because it's very fast anyway.

 

 

Link to comment
Share on other sites

To SMADELL,

 

Thank you for your suggestion(s). I'll give it a try, once 1.5 is out of beta and I can test your macros. BTW, I actually "Know" the one or two luminosity masks I'm after. If I'm trying to curves adjust the darks, you're right, I don't need to lights or mid-tones. It's just trying to figure out which mask I need between the two or three.

 

To MBd,

 

Your suggestion is interesting. But given I've had such trouble last time trying to understand blend ranges, I'm trying to see how they apply to luminosity "masks." I've seen your previous posts and referrals to to videos, which I've reviewed again. But might you have a photo example ready to share?

 

Thanks again to both of you.

Link to comment
Share on other sites

To SMADELL,

 

Thank you for your suggestion(s). I'll give it a try, once 1.5 is out of beta and I can test your macros. BTW, I actually "Know" the one or two luminosity masks I'm after. If I'm trying to curves adjust the darks, you're right, I don't need to lights or mid-tones. It's just trying to figure out which mask I need between the two or three.

 

To MBd,

 

Your suggestion is interesting. But given I've had such trouble last time trying to understand blend ranges, I'm trying to see how they apply to luminosity "masks." I've seen your previous posts and referrals to to videos, which I've reviewed again. But might you have a photo example ready to share?

 

Thanks again to both of you.

Blend ranges don't apply to luminosity masks

Blend ranges substitute luminosity masks (in a better, live, non destructive way)

 

Well I do not really know what example you´re after. In the official video there is an example using the moon and apart from that just every image that has luminosity variation, like just about every image, will do.

Sorry if that does not help much, hope you get blend ranges tackled at some point!

 

It you don´t, there is nothing technically wrong with using the old approach of luminosity masks if they work for you, but keep in mind that your workflow has some potential for improvement in that case.

 

 

If you use them to merge different exposures, I'd also strongly recccomend to try the new HDR merge in AP beta and see if you can work them towards a natural result from there on. Might be worth to utilise a powerful set of algorythms rather than manually adjusting every bit.

 

 

Link to comment
Share on other sites

To say that Blend Ranges don’t apply to luminosity masks is not strictly true.

Luminosity Masks are a form of layer masks that not only use black and white for the mask, but also use shades of grey. In using all shades of grey, luminosity masks are able to apply different levels of opacity to the mask. A typical layer mask that uses only black and white can only mask 100% of the pixel (the black part of the mask) or 0% of the pixel (the white part). A mask that uses shades of grey can mask a pixel by intermediate values.

Blend Ranges do the same thing. The blend ranges panel gives us x and y axes that set the opacity of pixels (the y axis) to the degree of luminosity (the x axis). In practice, the “whiter” a pixel is, the more luminous it is. In the blend range panel, the whiter pixels are represented by the right side of each graph; the blacker less luminous pixels are represented by the left side of each graph. The graph itself describes the opacity that is assigned to pixels of each level of luminosity.

In effect, Luminosity Masks and Blend Ranges are two different ways of saying the same thing. They just go about it in a different manner. Both boil down to alpha channels that describe the transparency of a layer.

The benefit of more traditional Luminosity Masks are that they are simple to apply - in the case of a macro, just click a button. The benefit of Blend Ranges is that they are infinitely adjustable, and can give live previews; on the other hand, they must be adjusted (at least to some extent) by hand and are therefore more confusing to some users.

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

@smadell that's awesome, I can't really thank you enough for what you provided, it really make affinity a viable option with these LMs.

I went form 'mildly disappointed' to very enthusiastic in 5 minutes, and potentially convinced me that I'm likely to buy affinity now that I know that this is in fact a doable thing, just hope it gets incorporated as a standard in a next release.
Thank you again.
I am new to Affinity so may I ask you how did you manage to create those masks in the forst place?

Link to comment
Share on other sites

Vicks…

I’m glad you found them helpful! Luminosity Masks were something I really wanted, and after much thought I finally wrapped my head around the use of Blend Options to get them to work. If you haven’t yet, you should search through the forum, the video tutorials, and the Help files within the application to understand Blend Options. They’re confusing, but worth it.

 

Each of the Luminosity Selection macros is made up of three steps. The first sets Blend Options for the layer; the second issues a “Selection from Layer” command, and the third resets the Blend Options to “normal.” The difference lies only in the curve that is placed into the Blend Options panel in the first step. The attached image is the curve set by the "Lights 2" macro.

As I said in a post above (#13) Blend Options and Luminosity Masks are basically the same thing. Since Blend Options change the visibility of a layer based on its luminosity, this was a wonderful way to emulate the visibility that results from traditional luminosity masks.

Again, I’m so glad you liked them!

post-12953-0-54433100-1478885073_thumb.jpg

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

  • 2 weeks later...

My pleasure!

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

Hi smadell,

 

I decided to test your Luminosity Masks Macro on the current Affinity Photo Beta 1.5RC, before 1.5 was final. Thanks for the opportunity. I’ve used luminosity masks before in Photoshop CS5, but I would like some help in understanding how to apply changes, once your luminosity mask is created.

 

In this example my image is loaded into AP Beta, your Macro is in the Library and I’ve chosen a mask (Darks 4) to use with my image. The expected luminosity mask is defined by marching ants:

 

Cursor_and_Affinity_Photo_Beta_-_MtDiabl

 

Unfortunately, the marching ants, having covered much of the image, is distracting while trying to apply a simple Adjustment, say Levels. The Levels works, but I can (barely) see the relative change on the screen, because the marching ants are so prevalent. I tried to delete the marching ants (cmd-D), but this not only deletes the ants; but any Levels adjustment is applied to the entire image, not only the Darks 4 mask.

 

I tried to go to Channels and press the button denoted to the red arrow, but that didn’t help me visualize the levels adjustment, as the red mask is prevalent over the entire image:

 

Cursor_and_Affinity_Photo_Beta_-_MtDiabl

 

How am I able see the entire image, knowing the Darks 4 mask is there without seeing the marching ants, so I can judge the effects of adjustments I do? (It’s helpful to know how the masked areas adjustment changes relate to the unmasked areas.)

Link to comment
Share on other sites

To Smadell and others,

 

Please ignore my past two posts regarding trying to figure out how to "see" the effects of an adjustment applied without the marching ants.

 

I finally figured it out. After selecting the adjustment (w/o adjusting) and just using the deselect button on the top menu bar (the dashed box with a red line passing through it.)

 

Sorry to have caused any problems.

 

Again Thanks to Smadell for the Luminosity mask macro, which I can now understand how to use.

Link to comment
Share on other sites

Good morning, WeiPhotoArts

 

It's important to remember a couple of things. First, the macros create Luminosity Selections, not masks. As such, they set you up for whatever your next step might be. You can create a mask from the selection (click the Mask button on the Layers panel), but you can also use them to create Adjustment Layers (like the Levels layer you wanted to make) or Live Filter layers. When you make such a layer, the luminosity selection is applied as a mask on the adjustment/filter layer. You can deselect the marching ants (Command-D) after creating the new layer or mask.

 

Also, the more recent iterations of Beta 1.5 have a menu item (View > Show Pixel Selection) which lets you turn off the marching ants but leave the selection active. Personally, I find this a little confusing (since I have to remember that a selection is active without the visual clue) but it is a way to get the distraction of the ants out of the way. If you use that frequently (e.g., turn it off then turn it back on to get a quick look) you should probably assign a keyboard shortcut to that View menu item.

Affinity Photo 2, Affinity Publisher 2, Affinity Designer 2 (latest retail versions) - desktop & iPad
Culling - FastRawViewer; Raw Developer - Capture One Pro; Asset Management - Photo Supreme
Mac Studio with M2 Max (2023}; 64 GB RAM; macOS 13 (Ventura); Mac Studio Display - iPad Air 4th Gen; iPadOS 17

Link to comment
Share on other sites

  • 4 months later...

Hi I am wondering how you recorded the macro, when I want to select the layer with crtl + click in windows 10, it pops up a message "cannot record selection from layer" and I can't record my own luminosity masks, I want 6 instead of 4, what can I do?

 

edit: I saw in your macro recording that you could record selection from layer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | 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.