In 1905 Einstein showed that incident light (photons - we don't know what those are yet) upon certain metals would produce a current flowing through the material. Thus light energy can be converted to electrical energy.

This is called the Photoelectric Effect

Imagine the surface of our digital detector is like the graph paper shown above. Each square can contain a certain amount of information - that is, receive a certain amount of incident light.

The more light that is received, the more electrical charge that is built up on that square. That charge is converted to a number so you computer might render the graph paper like what is shown below:

Once we have numbers to represent the light that hit the detector we can reconstruct a picture on the computer screen from the brightness values, as we see on the left. On this scale, 0 is completely black while 255 is completely white.

Note that because the light sensitive elements are so small, we usually don't see the individual picture elements ("pixels"). Reduced in size, we see what this star looks like at the usual level of detail. Individual pixels can't be seen by the eye at this scale, but they're there.

And Voila, we have Digital Imaging: