Here are my 2 cents on the topic at large based on my humble everyday experience.
Oftentimes you just don't need to mask these stray hairs. Nor actually your clients want it(even if they say so
). Doing this is a tedious work which most often gives mediocre results even with (lets be honest
) most sophisticated techniques you can find here or elseplace. And it does not pay off in the long run. Especially if you have a lots of requests like this on your backlog
Sometimes it is much easier just to imitate the stray hairs by hand.
It's actually very simple:
Just cut out the head roughly excluding the border stray hairs that catch the background somehow on it's own layer.
Add a new layer, choose some hair brush (there are a lots of them on the Internet or just use grass brush which comes with PS) and add new stray hairs at the border areas. Use Air Brush option and Brush attributes freely to change hairs density, size, direction, etc. to make these hairs look natural and similar to the source image. Add them as long as there is no discernible border between them and the underlying layer.
Lock this layer transparency and use clone stamp tool to color the stray hairs using the underlying layer as the source.
Finally merge the two layers together and you are ready to place it on any other background.
This saves you a lot of work and 99% of clients will never see the difference but will be happy as a clam with final result
Of course if you have a "special" client and you are ready to invest lots of your time and efforts to get "true" results you are free to go. Just make sure the client's gonna pay the price and won't forget you number once the project is done
.