photomopOpen the studio

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.

Resolution and scalingRuns on your deviceUpdated 10 August 2026

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 facts about Nearest-neighbour interpolation: also called, pixels read per output pixel, blending, best for, worst for, cleanest at
Quick factDetail
Also calledPoint sampling
Pixels read per output pixelOne
BlendingNone, source values kept exactly
Best forPixel art, masks, palette images, barcodes
Worst forPhotographs, especially when shrinking
Cleanest atWhole-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.

  1. Scaling pixel art by 2.5x and ending up with uneven block widths across the sprite.

  2. Using nearest neighbour to shrink a photo, which drops most of the pixels and leaves shimmering moire on fabric.

  3. 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.

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.