Hello and welcome,
Hello and well met.
it looks like a damaged sensor. Is the JPG out of the camera? What about an externally developed RAW image?
Yes it's out of the camera, and this will occur whether this is a JPG or a RAW (DNG) image.
If you can take usable pictures in complete darkness with flash then the mechanical shutter is stuck open. Either due to flex cable damage or other reasons.
Otherwise, it might be sensor failure as msl says.
I've tried the step you suggested and it seems that in pitch darkness only with flash this will still happen.
G7 is pretty old, it's seems possible it could be stuck for other reasons than wear. Was the camera unused for a long time before this started?
No. The camera was always being put to use occasionaly.
Last OK photo was this: http://imgur.com/hStJoxB
Before this started to happen, I carried the camera with me in it's camera case (a Case Logic one) which was within a cloth bag. Along with the camera inside the bag were my heaphones and a couple of fresh UPS batteries (with insulating tape on their contacts).
If you are able to do some scripting, you can try using the shutter eventprocs to close / open the shutter directly. This script http://chdk.wikia.com/wiki/Meteor_Intervalometer_with_Dark_Frame_Management should have the relevant eventprocs.
This could confirm for sure that the shutter is failed.
Thank you all for your replies, I will give a go with the script reyalp suggested and I will report back.