#research #research/imaging/techniques #data #signal-processing See also: [[Bilinear Interpolation]], [[Bicubic Spline Interpolation]], and [[Generalized Bicubic Interpolation]] # Nearest-Neighbor Interpolation Motivation: To review how this kind of interpolation can create image artifacts Nearest-Neighbor interpolation is a process in which a set of data is interpolated that incorporates the data information from its direct neighbors. Rather than attempting to calculating an average value for the data with a type of weighting criteria, the data is assigned a value based on the known data point closest to the nearest data point [^1]. The cited page gives a more algorithmic method of defining nearest neighbor interpolation, should you need to code it manually, though most programming systems and languages tend to have this baked in. No need to re-invent the wheel, just make sure you understand the math behind it. [^1]: https://www.giassa.net/?page_id=207#:~:text=Nearest%20neighbour%20interpolation%20is%20the,the%20intensity%20value%20of%20it. Nearest-neighbor interpolation can often create a "blocky" response in mapping the data, especially when mapping data that can have sizes that do not align one-to-one. Consider this two-dimensional case as a point: ![](https://www.giassa.net/wp-content/uploads/2009/12/upsample1.png) Without any subpixel processing, this image upscaling must consider how to map these pixels accordingly. ## Game Sprite Upscaling Example When I have worked with making art pieces that involve using sprites that need upscaling or if I want to upscale an older game image to a larger screen, I likely use Nearest-Neighbor interpolation. This ensures that I don't have to contend with any kind of blurring, I can maintain the visual fidelity of the sprites and can thus apply them in the fashion that I think is important. ## Other Tangentially Relevant Pages: - [[RetroTINK-4K]] which is a video processor that can scale games designed for CRTs to larger TVs - To be used with my [[MiSTer FPGA]] perhaps