Modern digital cameras have image sensors. These sensors have thousand and thousans of cells that change their charge based on what color and intensity of light touches the cell. The camera reads the charge of the cell and interprets it to a pixel on a screen or photo.
Latest Answers