The photograph of Roentgen shown above was obtained with a photographic film, and is an analog image. The brightness at any location is a continuous variable that ranges from a minimum (black) to a maximum (white), and can take on any intermediate value. The image intensity can be obtained at any location.
A digital version of this photograph can be obtained by sampling the light intensity along a two dimensional grid (middle). The sampling grid has 40 squares pixels) on the horizontal axis, and 60 grids on the vertical axis, so that there are a total of 40 x 60 squares in the grid. Each square (pixel) can take on a discrete value; for example, the intensity can range from 0 to 255 for a total of 256 shades of gray (see case 3 below). Suppose the grid is superimposed on the photograph, and the average intensity in each square is measured. Each square will take on a discrete value ranging from 0 (i.e., black) to 255 (white), with a value of 127 being an intermediate gray. The digital image is made up of 40 x 60 such discrete numbers and is shown on the right.
Digital image characteristics
Matrix and pixel size
Consider a conventional photograph that has dimensions of 20 cm x 20 cm (this is often referred to as the Field of View). When the photograph is acquired in a digital form with a matrix size of 1000 x 1000, then each pixel has a linear dimension of (20/1000) cm, or 200 micron (um). Increasing the matrix size to 2000 x 2000, reduces the pixel size to 100 m, whereas reducing the matrix size to 500 x 500 increases the pixel size to 400 m.
Each pixel must take on a discrete value. Use of 1 bit (binary digit) to "code" for the pixel value means that the pixel can take on one of two discrete values (1 or 0), which would correspond to a pixel that is either black (0) or white (1). If two bits are used to code for a pixel, then four discrete values are possible (i.e., 00, 01, 10, and 11). In general, if n bits are used to code for one pixel, the number of discrete values is 2n. 8 bits (equal to one Byte) can code for 256 discrete values (shades of gray); adding an extra bit will double the number of discrete values (i.e., 9 bits codes for 512 shades of gray), whereas subtracting one bit halves the number of shades of gray (i.e., 7 bits allows 128 shades of gray).
Computers normally store information using a discrete number of bytes; accordingly, the value of any given pixel will use 1 byte, 2 byte, 3 byte etc. The total number of pixels is given by M x N, where M is the matrix size in the horizontal direction, and N is the matrix size in the vertical direction. The total data in an image is thus given by N x M x bytes/pixel. For a 1000 x 1000 matrix size, with 256 shades of gray (1 byte), the storage requirements would be 1 Mbyte; increasing the shades of gray from 256 to 1024 would mean increasing the number of bytes per pixel from 1 to 2, and the image size to 2 Mbyte (note that using 9 bit, 10 bit, 11 bit
. 16 bit to code for one pixel would all require 2 Byte).