Tag Archives: image processing

Nearest Neighbor Interpolation for Resize Image

If you are not a computer scientist maybe you will think that resize image is an easy task. Just scroll the mouse wheel and all done. But do you know the process behind just “scroll the mouse wheel” ? I am going to discuss the simplest way of Image Scaling(what most people know as resize image). The most simplest way is Nearest Neighbor Interpolation, of course there are some other sophisticated interpolation methods.

Before we discuss about the method, It’s better if you’ve already known about the basic properties of image. If you aren’t , you can imagine images as a matrix. Look the picture below

Image[{{0., 1., 0.}, {1., 0., 1.}, {0., 1., 0.}}]
image matrix

Based on the picture above you can image if you have image with width=3 pixel and height=3 pixel so you have 3×3 matrix. If you have image 512×512 so you have matrix 512×512 (if your image pixel 8bpp or 1byte. I used 8bpp for example just for simple explanation).

Suppose we have 4×4 pixel image and we need to enlarge to be 8×8 pixel. We can imageine like this

Enlarge

Continue reading