I've had this ibook G4 for a little over a year, and I got it used, so I have no idea what happened to it before I got it.
About six months ago the screen went black, but you could still see the desktop if you shined a light at it. When you put the computer to sleep, then woke it back up, it was fine. We took the computer to the Apple store and they told us it was either the inverter cable, the logic board, or a random occurrence.
Within the past month, the screen going dark has happened a few more times. Putting the computer to sleep always woke it back up. This week though the screen has been randomly going completely black, the apple light on the back of the computer will go out, and it won't restart or shut down until it's been unplugged and its battery has been taken out. Then the screen usually goes black within 30 seconds of it being restarted.
Something that may be unrelated but I've noticed it that the power cord often flashes between green and orange, and sometimes the computer is plugged in and thinks its charging, but the battery won't gain any percent charge. Also, tonight I tried starting it up without the power cord plugged in, and the computer's screen has yet to go black. Is it possible that the power cord is somehow messing with the computer? Or does it sound more like the logic board is failing?
It sounds to me like either the LCD backlight is dying or the inverter cable has a short. Do you have the cable to connect the computer to an external monitor? If so, try that to see if the dimming still occurs. If it does, I think you're looking at a GPU failure, which often means a new logic board is in order.