Currently Being ModeratedMay 2, 2013 2:51 PM (in response to Gears_of_Peace)
This may be anything from a fail(ing) graphics card to a heat issue. I would start by vacuuming out the intake venty (where the memory door is) and look to see if there is dust build up. If there is dust restricts air-flow and could cause over-heating. If that does not solve your problem then run Apple Hardware Test in Extended Mode at least 3x in succession. If any errors appear your next stop is the Apple store or AASP for repair. If you don't know how to run AHT then please carefully read:
Currently Being ModeratedMay 2, 2013 7:30 PM (in response to Gears_of_Peace)
Could be an overheating issue.
When was the last time you vacuumed out/cleared out the dust, lint and dirt for. all of your iMac's vents, ports and slots?
You have to power down your iMac, disconnect everything and unplug your iMac.
Use either a small electronics vacuum or a standard vacuum with hose and crevice tool attachment and slowly and carefully vacuum out all of the various vents, slots and ports around your iMac.
Then, reconnect everything, startup your iMac. Download and install iStat Pro or iStat Menus temperature monitor and report your iMac's new temperatures here.
If this turns out to be a GPU issue, this may solve the issue or it maybe too late and the GPU is damaged or failing and you may have to bring your iMac in to Apple for diagnosis and repair/replacement service.