Light is everywhere, moving in all directions. Lenses allow us to use that direction information to take all light coming from the same place and send it to the same (different) place. This creates a projected image behind the lens. A sensor right where this image is measures how much of each color of light is at each point in the image, and saves that data. A picture can then be recreated from this data.
Latest Answers