Action to create Luminance Masks

Here everybody can post his problems with PhotoLine
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Action to create Luminance Masks

Beitrag von bkh »

Here's an action to create a series of luminance masks (as described in http://www.goodlight.us/writing/luminos ... sks-5.html) for a given image layer. To use this action, unzip the action archive, then open the Actions panel in PL, choose "Merge …" from the context menu and open the .actions file.

The action creates a group of greyscale layers, each containing one of the masks. The easiest way to use one of these masks is to shift-click on the layer preview icon in the Layer panel. This mask will also be used if you subsequently create an adjustment layer.

Note that the action is not a literal translation of the quoted article – instead of intersecting (multiplying) a mask by itself, I'm applying a gamma correction, and instead of subtracting from white, I use "invert", but the results are the same.

Comments and suggestions are very welcome.

Cheers

Burkhard.

EDIT: added new version of action file (just very subtle differences in the midtone masks, but probably closer to the PS original)
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Zuletzt geändert von bkh am Do 19 Sep 2013 23:33, insgesamt 2-mal geändert.
Pjotr
Mitglied
Beiträge: 140
Registriert: Sa 23 Mai 2009 22:17

Re: Action to create Luminance Masks

Beitrag von Pjotr »

Nice Burkhard. But wheres the file? :D
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Action to create Luminance Masks

Beitrag von bkh »

Pjotr hat geschrieben:Nice Burkhard. But wheres the file? :D
Oops. It's there now …
J i m
Mitglied
Beiträge: 13
Registriert: Fr 06 Jul 2012 13:38

Re: Action to create Luminance Masks

Beitrag von J i m »

Many thanks Burkhard this is just what I have been trying to do in Photoline.
I have have just been working on a portrait of my Grandson and your script worked great.

Jim
Dainis
Mitglied
Beiträge: 7
Registriert: Mo 12 Aug 2013 10:20

Re: Action to create Luminance Masks

Beitrag von Dainis »

Thanks a lot, Burkhard for the explanation and actions!
Could you explain a little bit more, how exactly midtones masks are created? I tried to do this on my own using 'substract' blending mode, but failed to create symmetric mask.
In theory, practice does not deviate from theory, but in practice, it does.
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Action to create Luminance Masks

Beitrag von bkh »

Dainis hat geschrieben:Thanks a lot, Burkhard for the explanation and actions!
Could you explain a little bit more, how exactly midtones masks are created? I tried to do this on my own using 'substract' blending mode, but failed to create symmetric mask.
The description says "start with the whole picture" and subtract the two masks. Translating this into layers, this means "white layer" in normal mode with the two masks on top in "subtract" mode. Since subtracting a layer from a white layer is the same as inverting the layer, you can also invert one of the masks, set it to normal mode, and put the other on top in "subtract" mode.

Probably, there is a slight mistake in the Luminance Masks tutorial – if you do this with the "Lights" and "Darks" masks, then you'll get a black "Basic Midtones" mask (this is clear if you note that the "Darks" mask is just the inverse of the "Lights" mask). My guess is that the author just intersected the two masks (or, in terms of layers, put one on top of the other in "multiply" mode) – I tried with his sample image and the result looks just like his mask.

Cheers

Burkhard.
Dainis
Mitglied
Beiträge: 7
Registriert: Mo 12 Aug 2013 10:20

Re: Action to create Luminance Masks

Beitrag von Dainis »

Your method looks logical to me. However, it looks also that something else is going on under the hood in PS.
I have got a video tutorial set from Sean Bagshaw (not worth if you use luminosity masks in a daily work, but for beginner like me it is) and he demonstrates creation of "Basic Midtones" exactly in described way: select all -> subtract Lights mask -> subtract Darks mask. Knowing that he didn't get black mask I assume that PS does some additional stuff that isn't obvious...

Anyway, your actions work wonderful and now I have a plenty of things to experiment with :D
In theory, practice does not deviate from theory, but in practice, it does.
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Action to create Luminance Masks

Beitrag von bkh »

Dainis hat geschrieben:Your method looks logical to me. However, it looks also that something else is going on under the hood in PS.
I have got a video tutorial set from Sean Bagshaw (not worth if you use luminosity masks in a daily work, but for beginner like me it is) and he demonstrates creation of "Basic Midtones" exactly in described way: select all -> subtract Lights mask -> subtract Darks mask. Knowing that he didn't get black mask I assume that PS does some additional stuff that isn't obvious...
Thanks for your feedback – if "Basic Midtones" works like that in PS, then my guess is that "subtract" in PS does "multiply with inverse mask" insteaad of subtraction in the mathematical sense. In that case, the result is the same as in the PL macro.

There'll be a slight difference in the other "Midtones" masks because I used the PL "subtract" for them. I'll see if I can modify the action to do exactly what PS seems to do.

EDIT: you'll find the modified action above. The midtone masks except "Basic" have changed, but the changes are very minor.

Cheers

Burkhard.
Martin Huber
Entwickler
Entwickler
Beiträge: 4298
Registriert: Di 19 Nov 2002 15:49

Re: Action to create Luminance Masks

Beitrag von Martin Huber »

bkh hat geschrieben:if "Basic Midtones" works like that in PS, then my guess is that "subtract" in PS does "multiply with inverse mask" insteaad of subtraction in the mathematical sense.
Every documentation I found says, that "subtract" simply performs a subtraction in the mathematical sense.

Martin
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Action to create Luminance Masks

Beitrag von bkh »

Martin Huber hat geschrieben: Every documentation I found says, that "subtract" simply performs a subtraction in the mathematical sense.
Maybe everybody just writes what seems obvious? There will be no difference between the two definitions at a given pixel if one of the masks is 0 or 1 at that pixel, so under normal circumstances, one wouldn't easily notice the difference.

Perhaps somebody with access to PS can do a little experiment? Draw a greyscale gradient (horizontal or vertical) from black to white and create Darks, Lights and Basic Midtone masks as described in the tutorial above. Then just post the Darks, Lights and Basic Midtone masks here. If PS does "subtract", then "Basic Midtone" should be just black, if it's "multiply by inverse", then the result should look like this:
subtract.png
If you get anything else, I'd be especially curious to see the mask layers.

Cheers

Burkhard.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Martin Huber
Entwickler
Entwickler
Beiträge: 4298
Registriert: Di 19 Nov 2002 15:49

Re: Action to create Luminance Masks

Beitrag von Martin Huber »

bkh hat geschrieben:Maybe everybody just writes what seems obvious? There will be no difference between the two definitions at a given pixel if one of the masks is 0 or 1 at that pixel, so under normal circumstances, one wouldn't easily notice the difference.
Well, the official documentation explicitly says, that it performs a subtraction and - with 8 and 16 bit - resulting values smaller than 0 will be clipped to 0. There's no need for clipping with a multiplication.
bkh hat geschrieben:Perhaps somebody with access to PS can do a little experiment? (…)
Examples are always helpful :-)

Martin
dlp0918
Mitglied
Beiträge: 2
Registriert: Fr 17 Mai 2013 06:31

Re: Action to create Luminance Masks

Beitrag von dlp0918 »

Please be gentle, I'm a newb :D

Once the set of luminance masks has been created by the actions, how do you use one of the newly created mask layers to create selections on the actual image itself?

Explanation of need: I want create a selection containing an over-bright area in an image so that I can treat that area differently from the rest of the image when I invoke the ColorPerfect tool.

Thanks in advance.

- David P
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Action to create Luminance Masks

Beitrag von bkh »

dlp0918 hat geschrieben:Once the set of luminance masks has been created by the actions, how do you use one of the newly created mask layers to create selections on the actual image itself?
Open the Layer Panel, then shift-click on the preview icon of the required mask layer.

Cheers

Burkhard.
dlp0918
Mitglied
Beiträge: 2
Registriert: Fr 17 Mai 2013 06:31

Re: Action to create Luminance Masks

Beitrag von dlp0918 »

Thank you, Burkhard.

- David P
mk3media
Mitglied
Beiträge: 7
Registriert: Mo 17 Sep 2012 16:35

Re: Action to create Luminance Masks

Beitrag von mk3media »

Works like a charm! Thanx Burkhard!!