Mate, I don't like to say it, but that is a hardware issue and usually related to a failing video card and/or mother board. I am afraid you will be up for a rather expensive repair on a pretty old machine. Could be time to upgrade your Mac. You could start trouble shooting by running the hardware test, but it will probably come back all clear. This is becoming quite a common occurrence for Macs of that age. I have seen quite a few recently. Sorry to be the bearer of bad news.
Does it look like this?
Frequent problem on 2006 17" imac!
Most of the time, it's a defective LCD panel.
To validate if it is the LCD panel or the graphic card, you can take a screen shot (cmd+Shift+3) and see if the problem is visible on the screen shot.
If it is not visible, then it's most likely the LCD panel.
This can be confirmed by connecting an external display to your iMac.
If it works well, then it's the LCD panel that is defective.
Replacing the LCD will cost too much money for a computer that is already 6 years old.
You can get a 21" screen at best buy for around $150.00
Mini DVI to DVI adapter for around $5.00 at Monoprice
HDMI cable for around $10.00