I thought it might be an optical illusion.

Literal

Eye [poss-の] illusion [Q-か] [quotative-と] thought.

錯覚 ('illusion, misperception') is Sino-Japanese: 錯 ('mixed up') + 覚 ('perception'). ~かと思った ('wondered if, thought it might be') embeds a tentative question within the thought.