Hilchos Lashon Hara, chapter 3, section 1
The prohibition of lashon hara applies even when it is true.
It does not matter whether a person says it secretly and is afraid that it will come out – in that case they also break "Cursed be he who strikes his fellow in secret" – or whether they feel they would say the same thing in front of the person. Both are forbidden and are lashon hara.
Saying it to the person's face can be an even bigger sin. Besides the prohibition of lashon hara, the speaker is acting with boldness and chutzpah. And sometimes it even leads to publicly embarrassing the person.