Images are represented to computers as grids of numbers, with each pixel corresponding to a number value. For black and white images, each pixel is represented by a single number value between 0 and 1. For color images, each pixel contains three number values for red, green, and blue intensities that together determine the perceived color, such as [1,0,0] for pure red and [0,1,0] for pure green.