To create the layer mask for the Bright curve I do:
1. Go to the output image from ZN and do: Selection -> All, and then Edition -> Copy. With this a copy of the image is in the Clipboard
2. Now show the layer mask of the curve by clicking on the curve icon while keeping 'Alt' pressed. At that time the mask will be totally blank. Do now Edition -> Paste. This will paste the luminance of the image in the layer mask (greytones image).
3. Without leaving the layer mask yet do: Image -> Adjust -> Invert, so that the Bright curve will affect less the highlights and more the shadows (that are the ones we want to lift).
4. Now adjust levels on the mask layer to your like: clipping to pure white all the areas where the curve must work 100% (i.e. the shadows of the scene), and clipping to pure black the areas that are to be 100% protected (the highlights).
5. Finally do some gaussian blurring (5-6 px radius, depending on camera resolution) to preserve microcontrast detail.
BTW there is a Linux version
working 4 times faster than the original, and a DNG output version is finally on the way.
The guy who translated the source code from VB6 to C++ is a C optimizer freak, and is doing a lot of improvements to my code to make it run faster. I hope we manage to do the DNG output version soon.