If 'nearest_neighbor' is selected, no interpolation over multiple pixels is performed. Instead, the resulting pixel is assigned the gray value of the pixel in the original image whose center lies closest to the center of the resulting pixel. The process is illustrated in figure 2.1:
In this example, the resulting pixel receives the gray value of pixel p10. Nearest neighbor interpolation is the simplest and fastest approach for determining the gray value of the resulting pixel. But typically, it leads to undesired effects like aliasing and jagged edges if the image is rotated or scaled.