It's possible that your graphics card is failing. If you have an older iMac that came with an Original OS X Installation Disk earlier than Lion, I would boot your computer from that DVD and run the AHT (Apple Hardware Test), or the Extended version, found on the disk to test your system.
Hope this helps
Do you mean that everything is displayed with a light blue tint? I have the same problem with my MacBook Pro, but never when I wake up.
I found a workaround from the user "Umputun" in this discussion: Blue tinted screen after mountain lion
See my reply in that discussion for details about how it works for me. I'm not sure if it'll solve you problem, since it happens for you when you wake up your iMac.