The Blend if the feature of Photoshop is one of the fastest and easiest ways to create luminosity and hue-based masks. However, it can’t be refined manually, unless you follow this tutorial to create a layer mask out of it.
Blend if is found in the Layer Style window of each layer (right-click on the layer, select "Blending Options"). It can be used to create luminosity or hue-based masking. Once you get a grip of this technique, you’ll hardly want to use any other kind of masking, as it allows for dynamic masking, meaning if you modify anything on the active or underlying layers, the mask will adjust automatically as it’s based on a comparison and not a layer mask. For more details on how Blend if works, be sure to watch the following video by Nemanja Sekulic.
The problem with this kind of masking, or rather blending, is also the most significant benefit: it’s not a pixel mask, but a comparison-based mask, meaning you won’t be able to go in and erase parts of the image or combine the mask with another one, at least not without the technique shown below. If you create a layer mask out of the comparison made by using the Blend if feature, then you can tweak your mask manually to your liking.
If you can combine both Blend if and the above technique, you’ll quickly be able to create an exact mask that you can adjust to your needs by hand. It’s an extremely powerful process and method to learn and master. For those of you who don’t shoot landscapes or architecture, don’t be fooled into thinking luminosity and hue-based masks are not for you! They can be useful even for portrait, beauty, or fashion retouching. I personally use them in almost every single one of my edits, and I don’t retouch landscapes or architecture much.