The "Hide Luminosity" script masks the image areas in proportion to their lightness. This lets you, for example, to instantly extract line art from a scanned drawing.
In case the current layer is not the "Background", after the launch, the script asks you to specify what to mask - only current layer or all layers (fig. 1).
On the screenshot 2, you can see the result of masking "all layers" (that is the composite image).
To swap masked and revealed areas, just invert the mask color (fig. 3) by pressing [Ctrl+I] keys.