• No results found

IMAGE STRUCTURE ADJUSTMENTS Interpolation

Many digital cameras will bring the image in at 72 pixels per inch (ppi). This is convenient for viewing on a computer screen, but not for printing, where we want about 300 ppi. Conversely, a scanner might bring an image in at 1000 ppi, and we still would want about 300 ppi for printing. The process of converting an image from one ppi value to another is called interpolation . In the former case, the process is called interpolating up, and in the latter it is interpolating down. There are three very common algorithms used for accomplishing this: nearest neighbor, bilinear, and bicubic. For simplicity we will discuss interpolating up by a factor of two in each dimension. This requires estimating new pixel values. Interpolating down, or to other ratios, uses the same basic concepts.

Figure 10.12 shows an extreme close-up of a portion of a gray-scale image. The pixels are clearly visible. To interpolate up by a factor of two in each direction, we need to create space for new pixels. Since we will interpo- late up by a factor of two, one space is inserted between each of the adjacent original pixels along the rows and columns, and then one on the diagonal. Next, values must be estimated for each of the new pixels. Following the nearest neighbor approach, the new pixels immediately adjacent to a given original pixel are given the same value as the original pixel. The result is that the image now contains four times as many pixels (two times the num- ber in both dimensions). However, the image looks exactly the same.

The nearest neighbor approach is useful when the ppi needs to be changed, but no change in the image is to be allowed. Presentation pack- ages, such as Microsoft’s PowerPoint software, interpolate (resample) images that are inserted into presentations to be properly suited to display devices. It alters the content of an image during this process (a bicubic process,

which we will take up later). It tends to smooth sharp edges. To avoid the alterations due to resampling, the operator can change the ppi to 92 (typi- cal screen values) using nearest neighbor. Then when the image in inserted into PowerPoint, its appearance will not change. In addition, prior to averag- ing several images together to try to increase the overall resolution, interpo- late up using nearest neighbor. In this process, the different image will not have the pixels aligned with the image detail in exactly the same way, and when averaged together, the new image will be able to combine the informa- tion from near pixels. But if more detail is to be seen, more ppi are needed. Nearest neighbor retains the pixel information in each image while allowing the averaging to occur at higher resolution.

FIGURE 10.12 Interpolation. The starting image is shown in the upper left corner. The pixels are separated to allow pixel-sized spaces in between each one. New pixels will be placed into each blank space. In this case, the nearest neighbor approach is being used so the new pixels get their brightness levels directly from above and to the left. This results in four times as many pixels, so the image is larger, but it looks the same. Other estimation processes can be used that will change the appearance of the image.

Although the nearest neighbor approach has its applications, it does not deal with image information in a way that always makes appealing prints. We often want to increase the ppi and smooth the transition between adja- cent pixels. This reduces the visibility of the pixels themselves in the print. A simple way to do this is to use the bilinear (bidirectional linear estima- tion) approach. In this case, the process starts the same way as before—a pixel space is inserted between each original pixel. It differs in how the sys- tem determines the value to assign to each of the new pixels. In the bilinear approach, the value assigned to each new pixel is the simple average of the original pixels on either side of the new one. The assumption is that if origi- nal pixel #1 has a value of 10, and original pixel #2 has a value of 14, it is reasonable to assume that a new pixel inserted in between them should have a value partway in between. A simple average is as reasonable an estimate as any, it would seem. This approach gives smooth-looking prints and gener- ally works well as long as there are no dramatic changes along pixel rows and columns.

When there may be dramatic differences, another approach can be used. This is the bicubic approach. This one is a bit more complicated, but has ancient roots. The process is based on a cubic spline. The cubic spline method is the same as the French curve method used in the days of hand- drawn mechanical drawings. Basically, a cubic polynomial is estimated for four points — the original pixels in a row.

Vo a V3 b V2cV1d

where V o is a new value computed from the original values, V , raised to the different powers. The values for a, b, c, and d are estimated using the values for the fi rst four pixels. This is for the fi rst set.

Using the cubic equation, the value for the new, intermediary pixel between the fi rst two pixels is estimated. When this is done, the next three pixels are used, along with the slope of the end of the fi rst cubic equation, and a new cubic equation is estimated. This is used to estimate the next new pixel’s value. Then the process keeps moving along. When all the rows are done, the same process is repeated for the columns ( bidirectional cubic spline ). With the new intermediary pixels in the rows and columns fi lled in, the same process can be used to estimate the new pixels that are on the diagonals. The bicubic approach gives excellent image renditions and is probably the most widely used approach for preparing images for printing.

Both the bilinear and bicubic approaches create values for inserted pixels that were not in the original image. Experience shows that interpolating up by a factor of two, or as much as four, does not misrepresent the original image. Interpolating up by more than this is not recommended since too many of the pixels in the fi nal image are the result of arithmetic calculation as opposed to the performance of the camera.

Note that the bilinear approach can estimate only straight lines between pixels, so more intricate patterns might be missed. The bicubic approach can interpolate using curves and is more sensitive to details.