Chosen Solution

Hi all, is there any way to fix this?

Update (12/17/2021) OK I managed to make the external display work: the imac was running Linux, and the second screen attached to the mini displayport through an HDMI adapter get no signal. So I created a Mac OS X installation boot usb stick and booted by USB. When running the OS X installation program, the second screen attached to the mini displayport was running fine.

Therefore I think the problem is in the screen.

If the external monitor shows a clean image then you will need a new display. Follow this guide iMac Intel 27" EMC 2639 Display Replacement and here’s the needed part 2012/13 27” iMac Display Assembly, Apple P/N 661-7169