iMac display shows yellow vertical bars and wont boot
Just yesterday I came into to look at my iMac and the display was frozen with lots of yellow "dots" all over the screen and totally unresponsive. I. managed to ssh in to it, so it was working, and then performed "sudo reboot". When it rebooted, the screen was grey with large yellow bars down it and it would not boot completely.
(Sorry it's the wrong way up, but you get the gist...)
I've reset the PRAM and booted into safe mode. This takes a very long time, but I do manage to get a login screen and the desktop, but with VERY slow video performace, and still have 5 yellow/blue stripes down the screen. After logging in, I can reboot it back into normal mode, but it sticks at the apple logo screen and fails to continue.
I've attached photos of the boot screen and the safe boot desktop.
Since this is late 2009 Mac, its well out of warranty, but any ideas would be welcome.
It's sort of usable in the current form, but not really for video and Safari web pages look really bad
iMac, macOS High Sierra (10.13.2), 16G RAM, Intel Graphics Adapter