Edited 2-oct-2018: Gradient from white(255) to black(0) processed with all the Masks are added for better visual understanding.
Original first post below:
As part of my learning process, a macro is made to create luminosity masks which are required for exposure blending and other masking
requirements where seamless effect is required. The same is enclosed and basic details are in the text file of the zip.
This can create six pixel layers each in the Lights, Darks and Mid tones.