It's all about context; I know you somewhat, so if the compliment about my hair is coming from you, that's something positive and I'll say thanks. When completely strangers come up to me and ask to touch my hair... Nope.
Similarly if you are photographing someone, that implies there's already a relationship, you already know that person and they know you, even if superficially, and since photography is such a visual thing complimenting people on their appearance in this context is perfectly natural and positive as long as no lines are crossed.
But when a complete stranger came up to me at a moto event, asked to take a photo with me and then said "Can I tell my wife I slept with you" - ...nope.
Sarah is spot on about compliments being sexualized, and this is what I was trying to convey. There's just absolutely no need for that, unless you are intimate with that person. There is ZERO need for sexual comments in any public space, be it work or school or the local coffee shop. Compliments are awesome, we all love them and we all love saying them, and as long as they are neutral - like someone's hair or tattoos, or someone's accomplishments and achievements, that's all wonderful. When it turns sexual, in most women's minds, that's an immediate red alert.
I was talking to someone on FB yesterday, an older rider who was asking me about bikes and traveling. After some 20 mins of pleasant, civilized conversation, he asked me where I was from and when I replied he said "oh, country X! I hear that women from X are the most beautiful in Europe" and added a smiley face.
And just like that, I was gone. I'm sure he meant it as a compliment and it probably was well-intended but to me, it was an instant WTF. We were talking about bikes and travel and he suddenly goes "women from X country are so beautiful"??
This sort of stuff reminds women exactly where our place is. I thought I was talking to a fellow rider/traveler as an equal, as a peer. With a comment like that, he immediately put me in a different place - that of a pretty object, not an equal rider/traveler anymore. I think this is what gets to me the most. I can be an accomplished rider and an experienced traveler but by saying something like that, all of that is instantly stripped away and I am suddenly just a pretty thing with no agency of my own. Just like that. I can't tell you how infuriating that is!!!!