Clipping Magic can help you separate out hair from clean and distinct backgrounds. Gradients and some noise typically work, as long as the colors involved are sufficiently different. Studio shots and photos with e.g. a clear blue sky as the background usually work well.
In the tutorial below we remove the background from the hair in this photo. You can follow along with this written tutorial, or try out this image for yourself in the Editor. View Example In Editor »
The example edits are slightly different from the tutorial below.
Mark foreground and background as usual, until you have a decent rough-cut result where the hair is cropped into a bit of a bob, but otherwise pretty good.
Original + Marks
Result
Use the Hair Brush and highlight the hair.
Original + Marks
Result
Stay pretty tight to the area that is actually partially transparent.
Zoom in and add select background and foreground pixel-level marks in the hair area to erase veils or bring back lost strands of hair.
To make this easier, the foreground and background brushes are automatically shrunk to single-pixel size when over hair.
Original + Marks
Result
Zoom far in - you really want the marks to hit as close to 100% foreground or background as possible.
Cycle the background color to better see what the result would look like when put onto different backgrounds.
Original + Marks
Result
The algorithm works by taking the colors along the boundary of the hair marks, assigning them to foreground and background based on the initial clip, and then reconstructing the interior based on that. This means that the boundary of the hair region must be consistent with the foreground and background colors inside of it.
Normally you want the hair marks to cover the dashed yellow-black foreground-background boundary. If your marks are close to the boundary but don't cross it, then chances are that will cause the algorithm to misinterpret what is foreground and what is background. This risks introducing gaps or retaining background patches in the result.
×
Original + Marks
×
Result
Be sure to cover the boundary well.
Sometimes the color of the person's shoulder can overlap with the colors in the hair background. Accidentally covering the shoulder with hair marks will then cause the algorithm to include these overlapping colors as both foreground and background candidates. This at best leads to a mediocre result.
×
Original + Marks
×
Result
Be sure to erase any hair marks that include conflicting colors.