Jump to content
smadell

Luminosity Masks for Adjustment & Filter Layers

Recommended Posts

About a month ago, I posted a number of macros for creating Luminosity Selections. These macros acted only on Pixel and Image layers, and could be used to create masks, adjustment layers, filters, etc. Today’s macros are a follow-up set, and are created to act on Adjustment Layers and Live Filter Layers.

These macros apply Blend Options to the adjustment and filter layers to produce the same results you would get with traditional luminosity selections and masks. However, these changes can be viewed in real time.

Instructions (see attached pictures):

1) Create an adjustment layer or a live filter layer like you normally would.

2) Apply the effect that the layer provides.

3) Now, click one of the Luminosity Blend Options macros to restrict the adjustment or filter effect to a luminosity range.


Notes:

1) Each macro restricts an Adjustment Layer or a Live Filter Layer based on the luminosity of the underlying composition - that is, the visible pixels in layers below the one being restricted.

2) NO additional channels are created, so files don’t become bloated.

3) Once you apply a macro to an adjustment or filter, you can change the luminosity restriction by choosing a different one, AND you can see the updates in real time. (For instance, if you want to darken an overexposed sky by applying a Levels layer, create the Levels adjustment layer and apply the “Lights 1 for Adjustments & Filters” macro. If you have affected too many of the midtones and darks, select “Lights 2 (or 3, or 4) for Adjustments & Filters” to restrict the adjustment toward lighter and lighter pixels.)

4) There is an additional macro called “Reset Blend Options to Normal” that will undo any changes the other macros have created, and return the Adjustment or Filter layer to its normal function.

Caveats:

5) Do not apply these macros to your baseline photo. They will not have the desired effect. These macros should be applied to Adjustment and Live Filter layers that are situated above the photo they are modifying.

6) As with my previous set of macros, 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) If you like them, they are yours. Consider this to be “pay it forward” software. Enjoy it.

 

* * * *

 

Edit (Dec 7, 2016) - The afmacros zip file below has been replaced with a new file, named differently. This is in response to the post which follows this one. The edited attachment should work better (or, should I say, it should simply work).

 

post-12953-0-15776300-1480907735_thumb.jpg

post-12953-0-22125800-1480907748_thumb.jpg

post-12953-0-29634600-1480907787_thumb.jpg

Luminosity Blend Options for Adjustments.afmacros.zip

Share this post


Link to post
Share on other sites

NormanPCN...

 

I tried to recreate this problem and - what do you know? - I imported an empty category too! Long story, short - when I renamed the category to omit characters such as "/" and "&" the macros exported and re-imported without a glitch. Maybe you'll want to try it again.

Luminosity Blend Options for Adjustments.afmacros.zip

Share this post


Link to post
Share on other sites

madell,


 


Thank you kindly for posting both the Luminosity Selections and the Luminosity Blend Options on Adjustment Layers and Filters.


 


Since the former Beta 1.5 RC-1, I’ve been trying to learn your Luminosity Selections for my future luminosity masking work on Affinity Photo. I have been able to test the selections and use them for masking in my work. I’ve also tested them on a grayscale with Tony Kuper’s TK-3 actions in Photoshop CS5. They match very closely in selection, and my AP use of the masking, though quite convoluted, also seem to match quite well. But I was wondering about the convoluted part, when your new Luminosity Blend Options came out recently. “smadell must have been listening to my requests,” I thought.


 


So I have two rather long requests. If this is not the forum for this, Moderator, let me know and I can email smadell, if that is acceptable.


 


Request 1 (Luminosity Selections):


 


a. I’m not familiar with AP macros. Is it possible to easily edit your macros to add an extra channel and rename it? Can you explain how it can be done, or create macros that can?


 


b. I can then probably create a small macro to Load my desired channel into the adjustment layer (that I’ve already chosen). This “mask” should then work.


 


c. Question: Some of my selections of darks, lights, or midtones are so complex and busy, it is hard to see what areas are actually masked. 


 


I’d like your opinion of what I did to visualize the mask. I’ve tried to load this selections, say Darks 3, into Background Alpha. This seems to give an inverted mask, where all the darks I want are dark or black, and all other luminosities are in different shades of white. If I then right-click on Background Alpha and select Invert, the picture seems to come out with a white mask (where I want to affect with the adjustment layer to affect dark areas), and all other parts seem to be in muted colors. Is this the mask of the traditional luminosity mask in Photoshop?


 


Regarding this point, I need to back out of this Background Alpha by 2 cntl-z ‘s, or the picture becomes totally mashed up. Can you confirm this happens to you, too?


 


Request 2 (luminosity Blend Options)


 


While my testing showed your Luminosity Selections closely follows the selections of the original Luminosity Masking work of Tony Kuyper, the work on luminosity Blend Options seems to differ. 


Please see the examples attached. They are jpegs that have been reduced in size for this forum to 1000 pixels on the long side, but the results show differences in the Luminosity Selections versus Luminosity Blend Options when adjustments are made and then viewed in full jpeg.


 


3 pictures below include the untouched gradient (0-AP-BW-Gradient-20161211), and 


luminosity mask (1-AP-BW-Selection-L1-20161211), & luminosity blends (2-AP-BW-BlendOption-L1AF-20161211), each applied to the untouched gradient with the same Levels Adjustment.


 


This same levels adjustment was applied to photo 01 and 02 as such:


Levels-Applied-to-1&2.jpg


 


It may be due to the fact that I’m not following a correct workflow. And I did notice when editing your macros for Luminosity Selections that you do use blend options there, too—as compared to the tradition Kuyper slicing and dicing of the luminosities by working selections on themselves. 


 


To better understand your Blend Options, I’d like to ask how you came up with the right had graph of the blend options screen? It appears that some pixels across the board (of luminosities) are selected, when in fact some should absolutely be excluded. Or maybe I’m just reading the Blend Options graph wrong. For example, in Darks1 for Adjustments and Filters,


 


Darks1-Blend-Options.jpg


 


the downward sloping line from upper left to lower right implies that some pixels from the left half of the graph will be picked (as they should, as this is darks 1), but some pixels (about 50%) from the whites will be picked also (in lessor amount), up to the highest luminosities. This is what I see in my examples above when I use Levels to test. 


 


BTW, I would like to understand how you came up with the other blend option graphs also, Darks 2, Dark 3 and Dark 4, as well as the midtones. Am just interested in how one works the blend to come out with a masking scheme. I tried a couple of months back, and all I could come up with was graphs with vertical & horizontal lines—before I gave up.


 


On the other hand, Levels changes with your Luminosity Selections macros (turned into masks) confine most all the the Level changes (and I might add curves) to those area of the mask.


 


Finally, when I get into the Darks 3 and Darks 4, comparing them to real images that I took, the effect of masking and blend options seem to be fairly near in effect, though not exact.


 


Sorry for the long-winded explanation, but I’m just trying to understand this masking and how blend option (hopefully) can provide a more efficient (no channels!) and easier method to apply blends (masks) to images.


post-6016-0-28222700-1481516574_thumb.jpg

post-6016-0-17258100-1481516575_thumb.jpg

post-6016-0-13167800-1481516576_thumb.jpg

post-6016-0-28794200-1481516577_thumb.jpg

post-6016-0-33279300-1481516578_thumb.jpg

Share this post


Link to post
Share on other sites

Hey, WeiPhotoArts…

First, the simple stuff. Yes, one of your responses in the original Luminosity Selections post was the reason I started thinking about the second set of macros. And, in response to your question about creating, naming, and utilizing additional channels, AP macros can create additional channels and use them, but I have not found a way to (i) rename them, (ii) select them based on name, or (iii) delete them based on name. Any new channel you create in a macro will be called “Spare Channel.” As far as utilizing the Background Alpha channel, I have simply not mastered that one.

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

About the macros themselves. Both the Luminosity Selections and the Luminosity Blend Options… macros are based on altering the Blend Options of the layers to which they are applied. The only real difference is that the Luminosity Selections macros apply blend options based on the luminosity of the selected pixel layer; the Luminosity Blend Options for Adjustments macros apply blend options based on the layers underneath the selected one.

Think about it this way. Open a photo and you have created a pixel layer called “Background.” Now apply an adjustment layer, which sits above the pixel layer. The Luminosity Selections macros can be applied to the Background (pixel) layer; the Luminosity Blend Options for Adjustments macros can be applied to the Adjustment Layer.

Both sets of macros use the same values in the Blend Options panel - the difference is only whether they evaluate the Source Layer (the left graph) or the Underlying Composition (the right graph).

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

As to my choice of values in the Blend Options graphs, my thinking was generally as follows.

1) Luminosity based selections/masks apply differing amounts of selection based on the whiteness or blackness of any given pixel. If you accept that premise, then every pixel in an image should have a corresponding amount of selection.

2) In the simplest case (Lights 1), the graph is a straight line. Pure black is 0% selected, Pure white is 100% selected, Neutral Gray (50% gray) is 50% selected.

3) In creating a curve for Lights 2, I applied the equation y = (x*x), where y is the percentage of selection and x is the percentage of luminosity. So, Pure black is still 0% selected (since y = (0 * 0)) and Pure White is still 100% selected (since y = (100% * 100%)). However, Neutral gray is only 25% selected (since y = (50% * 50%)). Think of this as applying a luminosity selection, then applying it again.

4) Values for the Lights 3 and Lights 4 selections extend that same thinking. For instance, in Lights 3, neutral gray is selected (50% * 50% * 50%). The blend options curve for Lights 3 therefore has a point where 50% on the x axis (luminosity) has a corresponding value of 12.5% on the y axis (percent selection).

5) The Darks 1, 2, 3, and 4 curves are simply the inverse (mirror image) of the Lights curves.

6) The Midtones curves start with the assumption that Neutral Gray should be selected 100%. The other values include 0% selection for both Pure Black and Pure White. This results in a triangular selection with the top of the triangle at x=50% and y=100%.

7) The Midtones 1 curve, therefore, has a value of 50% selection (y axis) for both 25% luminosity and 75% luminosity (x axis). The Midtones 2 curve changes that to a 25% selection (50% * 50%) for these points. And so on…

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

As to your other concerns, I can only offer the following. First of all, I don’t own Photoshop and I have no experience with Tony Kuyper. I have applied my own logic to the construction of luminosity selections/masks, and have not relied on the work of others. As such, there may be differences in results. Second, my understanding is that Photoshop relies on “intersecting” selections, and this is done differently in Affinity Photo. A direct implementation of Photoshop methods may simply not be possible. AP is, in my estimate, the more elegant of the two.

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

Last, you suggest that your results differ when you use corresponding macros from the two sets. This should not be so, since the blend options curves are the same.

I started with a simple White to Black gradient.

post-12953-0-09734800-1481562710_thumb.jpg

I then applied the Darks 2 Luminosity Selection macro.

post-12953-0-58688600-1481562731_thumb.jpg

With that selection active, I added a Recolor adjustment (using the default value of pure red). This is the result I got.

post-12953-0-72574800-1481562753_thumb.jpg

Then, I started with the White to Black gradient again, added the Recolor Adjustment, and applied the Darks 2 Luminosity Blend Options for Adjustments macro with the Adjustment Layer selected. This is the result.

post-12953-0-29276600-1481562769_thumb.jpg

To my eye, the two results are exactly the same.

Share this post


Link to post
Share on other sites

not mentioned, but implied: use of blend options allows you to precisely feather the range of luminosity affected by the layer (using curves instead of linear selections). The range defined can thus be very precise and appropriate to the image at hand -- something not possible in PS. 

 

Michael

Share this post


Link to post
Share on other sites

Thanks for luminosity mask macros!

Indeed, I always use them in my PS workflow, with Tony Kuyper's TKactions panel and TK infinity mask panel.

I hope there will be a porting to AP!

Share this post


Link to post
Share on other sites

Thank you smadell !


 


Sorry for taking so long to reply after your quick and clear answers to my long post.


 


I thought I would reply point for point. Then I thought to myself of a different situation I faced almost a decade ago—my switch from Windows pc to Apple iMac/OS. For almost a year after my switch I ponderously applied my Windows workflow on the iMac and MacOS. I don’t know when the clouds lifted so I could understand that I had a new system—so why don’t I dive in a try the “new” way? The iMac/OS became so much easier to use. And to this day I’m so glad I switched.


 


Same thing here. I didn’t mean to suggest that your (or anybody else’s) software should duplicate the Photoshop workflow. After all, that’s why we all switched to Affinity Photo.


 


Your explanations of how you came up with the Blend Options made me much more comfortable about applying it to my masking.


 


So I thought it would be better if I would take the time (and that’s why I’m late), to test your two macros with many of my RAW images that had already been tweaked in Lightroom. But were looking for some tone adjustments and some luminosity adjustments.


 


I began to learn how to employ both macros. Luminosity Selections to determine what luminosity mask(s) to use, and Luminosity Blend Options to implement the adjustments. In all of my test cases, the macros helped improve the images by providing the mask and feathering it automatically. I’ve also learned to “read” marching ants masks and use AP’s masking tools to visualize what the mask looks like, to be better prepared to use the luminosity mask adjustments.


 


As an aside, I also learned how to change the Luminosity Selection masks, in case the marching ants did not exactly fit the mask I was looking for.


 


So again, thanks for your generosity sharing your efforts, your software, your explanations, and your support. Please keep both macros active. I use them both!


 


Wei


 


PS: My efforts in applying your macros led to more curiosity questions, which will be in the next post. This time, a bit shorter than last time...


Share this post


Link to post
Share on other sites

To AstroMax,

 

I've already asked Tony Kuyper about porting not only the macros, but the 3rd party menu of his TK3.

 

This will not be done until Serif of Affinity Photo allows 3rd party html-like menus. So this is a very long-term wish. I have a request into Affinity Photo.

 

But with the current Dashboard, given the many requests for 3rd party plugins like Topaz and Tonality Pro and others to work (they mostly don't, right now) the need for a database/browser, and the upcoming Version 2.0 later in 2017, I think this won't happen for a couple/few years. And you can be using smadell's software in any case. 

 

Wei

Share this post


Link to post
Share on other sites

OK, smadell, here are my short questions:


 


1. Have you tried curves for the midtone selections? I feel the feathering in darks and lights, both being curves, are more natural. No proof, just a feeling.


 


2. Have you experimented by limiting your curves on the left or right? What I mean is that you change the Blending Options graph (say midtone-1, which is a symmetrical graph pointing up in the middle, but tethered to the bottom left and right points. Have you tried pulling the left (or right, or both) points away from their ends and towards the middle? If so, what have you seen in your images—and did you expect the result?


 


3. How do I “see” the Blending Options graph in your Luminosity Selections? I know I can “see” them in your Luminosity Blend Options for Adjustment by pressing the gear option in Layers; but when I do that in your Selections, the graph that appears just has 2 straight horizontal lines on the left and right.


 


 


Wei


Share this post


Link to post
Share on other sites

Wei...

 

1) For the midtone blend options, using "linear" settings was simply easier. I found it too difficult to find points that gave me a smooth curve that I was happy with. In theory, a curve would be better for Midtones 2 through 4. In practice, I doubt the difference is significant.

 

2) The math that governs my blend option points dictates that the curves extend all the way to both ends of the graph. For instance, if Lights 1 is a line that extends from 0,0 to 100,100 then Lights 2 should be the same, except with different y values in the embedded graph. Of course, since these are all done in blend options, you can certainly change the values by doing it manually.

 

3) The blend options graphs in the Selections macros are exactly the same as the graphs in the Adjustments & Filters macros. The only difference is that the former is placed into the left graph, and the latter is placed into the right graph. But, if you are hell bent on actually seeing them for yourself, right click on one of the Selection macros and choose Edit Macro... In the Macros panel, uncheck the 3rd step in the macro and (with a pixel layer selected) click the play button. Once the first 2 steps are completed, click the gear icon to reveal the Blend Options panel.

Share this post


Link to post
Share on other sites

If users had the ability to create panels which hooked into the API, I'm pretty sure we would see a burst of plugins from the community. I just wish there was some kind of scripting in order to make this happen.


High-End Photographic Prints

 

 

Share this post


Link to post
Share on other sites

I'm confused. Why are you all referring to "Blend Ranges" with "Blend options"? Is it called something different in the PC version? I know what you're all talking about, but nowehere in my version does it refer to Blend Ranges as Blend Options. Iin trying to explain how this works to non AP users, they get confused easily when the wrong terms are used. Especially since Blend Options in PS refers to the "Normal, Darken, Darken Colour etc etc." settings you can apply to individual layers.


FInd me at:

 

Facebook: https://www.facebook.com/GM-Photography-142947659079869/

 

Flickr: https://www.flickr.com/photos/gmphotography32/

 

or my personal website, not kept frequently up to date: www.gmphotography.ca

 

I use Affinity Photo, Lightroom, Panorama Maker 5, and Photomatix for my photography.

Share this post


Link to post
Share on other sites

I don't know what the Windows version calls Blend Options, but it would surprise me if the name were different. The Layer settings that allow interaction with the layers below (e.g., Multiply, Screen, Color Dodge, Overlay, etc.) are called "Blend Modes." If you look this up in the Affinity Photo Help file, you will find it labelled as such. If, however, you have a layer selected and want to change the opacity locally (based on luminosity values) you click the "gear" icon near the top of the Layers panel. This opens a separate panel in which one sets the "Blend Options" - and it is named as such at the top of the panel. See my screen grab below...

 

post-12953-0-61737000-1487963350_thumb.jpg

Share this post


Link to post
Share on other sites

Hi Smadell.

Many thanks for all your work on the luminosity selections. I have encountered an issue, which hopefully you may be able to help clear up.

I'm trying to blend two images together, a dark one for correct highlight exposure and a light one for correct mids / darks exposure. I have the dark image sat above the light one and I have used the lights 2 macro on he light layer to create a selection. When I then apply a black mask to the dark layer and try to use the selection as a brush limit, I find that the brush tool ignores the selection and allows me to paint over the whole of the mask (not what I was expecting). 

Could you possibly clarify whether this is the correct behaviour of the selection, a bug in Affinity or, as is the  probable cause, user error on my part?

Once again, thanks for the great work in making the macros and making them available.

Share this post


Link to post
Share on other sites

As with so many things, there is a short answer and a long answer.

 

The short answer is that you may be making things too complicated. In your arrangement (dark layer on top, light layer on the bottom) you have made a Lights 2 selection on the bottom layer, moved to the top layer, and want to apply this selection to a mask to allow the lighter portions of the top layer to show, but the darker layers from the bottom layer to peek through. Did I get that right? If that's the case, then once you make the selection on the bottom layer and then select the top layer, just click on the mask icon at the bottom of the Layers panel. This will create the mask you want on the top layer; no need for extra painting on the mask itself.

 

The long answer is that you are assuming that your Lights 2 selection has only selected a certain number of pixels, and not others. But that's not really how luminosity selections (masks) work. In fact, ALL of the pixels are selected. What varies is HOW MUCH they are selected. In other words, a Lights 1 (for simplicity sake) selection will select the White pixels 100%, but will only select the middle grey pixels by 50%. But they are all selected! And that is why you can paint over the entire mask.

 

Once you have that selection active, painting on the mask does indeed get limited to the selection. But, since all of the pixels are selected to one degree or another, you can paint on all of them. If you paint black on a mask with a luminosity selection active, what will happen is that the black will paint over all the pixels, but will paint in varying shades of grey as you apply a brush stroke.

 

For instance, if you have an area of 50% grey, then those pixels are 50% selected. If you paint black in the mask with the selection active, then you are painting 50% grey over the already 50% grey of the mask.

 

I guess that my point is that the luminosity mask already has a greyscale aspect to it, and I'm not sure why you would need to paint on it at all. I've always found that painting onto a greyscale mask is kind of dicey. If you want to alter the mask by painting, you might do better to create a greyscale pixel layer from your selection, paint on that, and then "Rasterize to Mask" and drag the mask to its desired location.

Share this post


Link to post
Share on other sites

Hi Smadell.

Many thanks for the answer, I was fully expecting the operator error answer ;-). Having read some of your other posts I experimented further by creating my own luminosity selections and creating a mask from then. This, as you said produced a grey scale image, the bit I find intriguing is what do the marching ants represent? I'm guessing it represents a threshold. Anyway to cut a long story short, I'd seen some youtube from Jimmy McCintire (spelling?) using photoshop with luminosity masks where he was painting into a selection to further blend the result, this is what I was attempting. Mostly I'm happy with the blend ranges result, but the image I was adjusting wasn't playing ball due to the tonal range, so I thought I'd try something different. More experimenting required I think.

Once again many thanks for the quick, informative, response.

Share this post


Link to post
Share on other sites

I am trying to import these macros  on AP windows trial. First of all AP is looking for an .afmacro file not an .afmacros file. Secondly, I renamed the file to .afmacro and tried to import the macro.  Nothing happens ...


Am I missing something here?

 

Thanks in advance

Phil

(BTW, the same file works fine on the iPad version named .afmacros)

 

Share this post


Link to post
Share on other sites

When trying to apply luminosity mask to my adjustment mask I'm getting selection of a whole picture, so there is not expected effect. I can apply luminosity mask only directly on my base image. I've red instructions, seen photos I think doing everything as it should be, but something not working...

Update to moderator, I found answer, so if you can please delete my post, thanks

Share this post


Link to post
Share on other sites

Mistera...

What is it that isn't working? Were you able to Import the macros into your iPad version? Or, do they just not seem to be doing anything? (And which "other two macros" are working?)

- smadell

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.