The image appears to reflect the possibility of graphic processor card issues.
Some models had a history of failure or bad solder connections; others may
have a combination of capacitors & other hardware; eventually needed repair.
https://duckduckgo.com/?q=imac+24-in+2008+graphic+anomalies&t=ffsb
One of the cures for some graphic card issue, was a re-solder done by the
users who took their card out of the computer & baked them in kitchen oven.
This idea worked for some; you may be able to contact an Authorized Apple
Service Provider or see if one of the online parts vendors can answer questions
about availability of replacement refurbished graphic cards, if one yours has
can be removed from the logic board or if it is affixed, or soldered to the board.
An iFixit.com repair guide for your series of iMac (Intel-cpu 2008) 24-inch
may show if that section can be practically removed, if so will show process.
https://www.ifixit.com/Device/iMac_Intel_24%22
The computer detail in the bottom of your post is not a G5 model iMac, and
there were no powerPC G5 processor-equipped Macs after model year late
2005 to early 2006; so if the computer in the discussion is a G5 it is not 24-in
and would be an Intel-based model. These use different architecture than G5
powerPC though in some ways are similar at least in general design.
This contains all ifixit repair guide for Power G5 iMac (no 24-in model exists)
https://www.ifixit.com/Device/iMac_G5
If you have both an Intel-based iMac and an older PowerPC G5 iMac, specify.
Don't know if a reset of the SMC or NVRAM may affect the symptoms or change
the visual problem in the display; an underlying hardware problem is a likely cause.
• Resetting the System Management Controller (SMC) on your Mac - Apple Support
• How to Reset NVRAM on your Mac - Apple Support
If this is your model iMac (24-inch Early 2008) the build model identifier follows:
Introduced April 2008
Discontinued March 2009
Model Identifier iMac8,1
Model Number A1225
EMC 2211
Order Number MB325LL/A
Initial Price $1,799 (2.8 GHz) $2,199 (3.06 GHz)
You may be able to find part numbers and search for repaired or new replacement
old stock graphic cards. A friend had one of these 24-inch 2008 iMac models and
it failed due to graphic processor; where she lived the BestBuy did not want to fix
it although it was bought from them with their extended warranty; not applecare.
So there are some out there in near perfect condition, but not repaired, still.
Not sure if the costs involved would be worth the value compared to a different one of
later build that may have no similar design build history. {Confirm the iMac's identity.}
Sorry that I don't have any new ideas in regard to this problem. 😐