In its simplest form, a digital image can be thought of as an array of a given size whose cells are pixels (short for picture element). In a binary (or monochrome) image, each pixel takes one of two values, 0 or 1, distinguishing colored cells from uncolored ones. The image is a function f (x, y) taking values in {0, 1}, where x and y are the coordinates of the pixel within the image.
Black and white, and color ----------------------------
A grayscale representation allows for finer gradations by assigning each pixel a value between 0 and 255. This range covers an entire palette of grays, from black (value 0) to white (value 255). The gray level is therefore encoded using eight bits.
####