The electronic flash on a camera uses a capacitor to store electrical energy from a battery. This energy is then dumped into a flash tube to produce light for photography. The amount of energy needed for the flash depends on the light power output and duration of the flash. Not all electrical energy is converted to light - some becomes thermal energy. Capacitors recharge between flashes using resistors, and the resistance can be calculated from the capacitor's capacitance and recharge time constant.