Image Resizing

Background

Because the typical printer uses 300 dots per inch (dpi) and typical images are only several hundred pixels in width and height, printed images are usually quite small. Our program allows the user to resize the image, making it bigger OR smaller.

Methods

To allow as many different combinations of image sizes, the resizing process is broken into two steps: the image is first expanded and then sampled. This handles non-integer resizing, so for instance, a user could expand an image by 1.5 times.

Expansion by Pixel Replication: Pixels are simply repeated a given number of times. An image that needs to be expanded by 4 times in each direction means that each pixel now occupies 4 x 4 = 16 pixels. We would expect that this process would produce a block-like look, especially for curves.

Expansion by Bilinear Interpolation: This method linearly interpolates between the known pixel values. This should produce a smoother but blurrier look, especially with edges.

Results

Functionality of Program: A circle of 400 x 400 pixels was run through the program and resized to 600 x 600, 100 x 100 and 310 x 510.

Comparison of Pixel Replication vs. Bilinear Interpolation: Three different images were used to compare these two methods. The first image was a white circle of radius 200 pixels on a black background. The second image was a set of black and white lines. The last image was a full color image of lena.

Conclusion

Pixel replication performs better than bilinear interpolation for edges, as expected. However, pixel replication did not show the block-like look that was expected. Nor is there a noticeable difference between a photographic image, such as lena, that has been resized using pixel replication and bilinear interpolation. For the photographic image, we only doubled the image size so perhaps resizing the image by a larger proportion would produce more noticeable effects between the two methods.


previous home next