My Screen is flickering but external monitor works fine

Today I turned on my iMac and found that it started to flicker and display weird colors. Not sure if is the display or the connection. Is there a way I can check it?

I tried to connect an external monitor and it worked fine so I don't think it is the GPU

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0