Algorithm of hair color changing
I have two images: a face and a mask. Mask contains only 0's and 1's, and it selects hair. I want to change hair color and paste it back into the image.
I've already tried to change H in HSV representation of the image, but I have a big trouble with black hair. If I change only H then black remains black. If I try to change S or V, the image becomes slightly unnatural because hair becomes too bright and strike the eye.
Also I tried to use histogram matching, but there was the same problem: hair and face didn't match.
Is there any algorithm to do that? I beleive it must be relatively simple, but I can't understand how to do that.