I think it depends on the person who gets offended by being called so.
According to 日本語俗語辞書 ( http://zokugo-dict.com/05o/otaku.htm ),
オタクとは、特定の分野に関して強い興味を抱き、関連するものを収集したり、詳しく知ることに時間を費やす人のこと。【年代】 1989年
To translate it, 「オタク」 means a person who has an strong interest on a particular field and spend more time for knowing the subject or collecting the related goods.
In my opinion, 「オタク」 used to have a negative connotation. It meant "nerd" except that the person's expertise doesn't have to be computers but often Anime, Manga, video games, or anything subculture. The term often implied social impairment of the person.
The origin of the word is not clear even for Japanese. It is said that when otaku people talked each other, they used 「お宅」 to refer to the second person instead of saying "you". Or they are kind of people who barely goes out but stays home. (「宅」 means home.) Or a columnist, 中森明夫, used it for the first time in a Manga magazine called, 漫画ブリッコ in 1983 ( http://www.nikkoku.net/tomonokai/toukou_card.html?snum=148).
About for this decade I would say, it has been used more openly to describe the person's characteristics which is maniac/specialized on a particular field with a positive connotation. But the term still suggests that the person is being obsessed about something and not normal/crazy/ill and less social so it may offend somebody who want to be considered normal.
「秋葉系」「キモオタ」 should be the alternative words for pre-オタク. The link describes the typical 「秋葉系」 although it is exaggerating to make it funny for a TV show. http://matome.naver.jp/odai/2130699281942633401
X君は変わってるね
is definitely not derogatory and has a broadly similar meaning.