You forgot to mention which G4. Always tell us the processor speed. That is the best identifier for a Mac.
The iMac G4 was 700MHz, 800MHz, 1.0GHz, or 1.25GHz. You will run into a "brick wall" trying to install OS 10.5 (Leopard) on any Mac less than 867MHz processor speed. To get past that, install LeopardAssist, free, first link below. If you find it runs a bit slow on a 700MHz, install OS 10.4. That will be a bit faster not only because it needs less processor power, but also because the OS 10.5 retail installation has a lot of multi-platform code to enable using it with either PPC or Intel. In a sense, it is bloated from the kernel on out to allow it to work on both processor types.
Minimum System Requirements for OS 10.5.x:
* Mac computer with an Intel, PowerPC G5, or PowerPC G4 (867MHz or faster) processor
* 512MB of memory
* DVD drive for installation
* 9GB of available disk space
* Some features require a compatible Internet service provider; fees may apply.
* Some features require Apple's MobileMe service; fees apply.