Interpolation by the nearest neighbor


Closest neighbor interpolation (also known as proximal interpolation or, in some contexts, point sampling) is a simple multivariate interpolation method in one or more dimensions.

Interpolation is the problem of approaching the value of a function for a non-given point in space when the value of that function is administered on points around (neighbors) of that point. The nearest neighbor algorithm selects the value of the nearest point and does not take into account the values ​​of neighboring points, producing a constant interpolator by chunks. The algorithm is very simple to implement and is commonly used (usually in conjunction with mipmapping) in real-time 3D rendering to select the color values ​​of a textured surface.

wiki