Scaling pixel art by 2.5x and ending up with uneven block widths across the sprite.
Resolution and scaling
Nearest-neighbour interpolation
Also called nearest neighbor, point sampling or pixel art scaling. Here is what it means, when it changes what you export, and what people get wrong.
The short answer
Nearest-neighbour interpolation sets each new pixel to the value of the closest pixel in the original, with no blending at all. It is the fastest resizing method and the only one that preserves exact original colour values, which makes it right for pixel art and wrong for photographs.
Updated
The short version
Nearest-neighbour interpolation at a glance
| Quick fact | Detail |
|---|---|
| Also called | Point sampling |
| Pixels read per output pixel | One |
| Blending | None, source values kept exactly |
| Best for | Pixel art, masks, palette images, barcodes |
| Worst for | Photographs, especially when shrinking |
| Cleanest at | Whole-number scale factors |
Slide the table sideways to see every column.
When is it the correct choice?
Whenever blending two neighbouring values would produce something meaningless.
- Pixel art and sprites scaled by whole-number factors, where every block should stay hard-edged.
- Segmentation masks and index maps, where pixel value 3 means one category and 4 means another. Averaging them gives 3.5, which names nothing.
- Palette images, where each value is a lookup into a colour table rather than a brightness.
- QR codes and barcodes, which are read as hard black and white and tolerate no grey edges.
Why does it look so bad on photographs?
Enlarging simply replicates each pixel into a square block, so you get visible stair-stepping on every diagonal and the classic pixelated look. Shrinking is worse. Reducing by 4x means the filter keeps one pixel out of every sixteen and ignores the rest, so most of the image never influences the result. Fine repeating patterns beat against the sampling grid and turn into moire, and a one-pixel line can vanish entirely if the grid happens to miss it.
Why do whole-number scale factors matter?
At exactly 2x, each source pixel becomes a clean 2 x 2 block; at 3x, a 3 x 3 block. Every block is identical and the pattern stays regular. At 2.5x the arithmetic cannot divide evenly, so some pixels become two units wide and others three. On pixel art that shows as uneven outlines and inconsistent stroke weights; on a screenshot of text it makes letter spacing look ragged. If you are using nearest neighbour deliberately, stick to whole multiples.
What people get wrong about nearest-neighbour interpolation
Each one is a real failure mode, not a style preference.
Using nearest neighbour to shrink a photo, which drops most of the pixels and leaves shimmering moire on fabric.
Applying bilinear or bicubic to a segmentation mask, which invents in-between label values that mean nothing.
Questions people ask
Nearest-neighbour interpolation, answered
The follow-up questions people search for once they have the definition.
Why does my enlarged image look blocky?
Either it was resized with nearest neighbour, which copies pixels into hard squares, or it is being displayed well beyond its native resolution. Switching to bicubic softens the blocks; getting a larger original is the only fix that adds real detail.
What is the best way to enlarge pixel art?
Nearest neighbour at a whole-number multiple, such as 4x or 8x. Any smoothing filter blurs the deliberate hard edges that define the style, and a non-integer factor makes some pixels wider than others, which breaks the grid the artwork was drawn on.
Is nearest neighbour faster than other methods?
Yes, by a wide margin. It reads one pixel per output pixel with no arithmetic beyond rounding a coordinate, where bicubic reads sixteen and weights them. That speed is why it still appears in real-time previews, though the quality cost makes it a poor final choice for photos.
Same cluster
More from the glossary
Neighbouring entries, so every term in the set is one hop from every other.
On-device inference
On-device inference runs a machine learning model on the hardware in front of you, your laptop, phone or browser tab, rather than sending data to a server.
Native resolution
Native resolution is the pixel dimensions an image was actually captured or rendered at, before anything resampled it.
ONNX
ONNX (Open Neural Network Exchange) is an open format for saving a trained model so a different framework or runtime can load it.
From the studio
Tools that do this
Each one runs on your own device, so the photo stays where it is.
Keep reading
Elsewhere on Photomop
Platform image rules
Image size, file type and background rules for 22 selling platforms, each one sourced.
Read itConvert image
JPG, PNG, WebP and AVIF, with an honest answer about HEIC and alpha.
Read itAll the tools
The whole toolbox in three families, with what each one needs before it can run.
Read itOn-device privacy
The pipeline in five steps, what leaves your device, and how to check it yourself.
Read it
Now do it to a photo
Photomop is a photo studio that runs on your own device. Resize, crop, compress, convert, batch edit, remove a background and change one all work in the browser tab you are reading this in, at full resolution and with no watermark. The on-device page shows you how to check that the photo stays put.