FitMyPic

Upscaling

Enlarging an image: what the filters actually do, measured

Upscaling adds pixels, not information. Here is what each filter does to an edge, why haloes appear, and the point at which enlarging an image stops being worth it.

By FitMyPic Editorial Published 2026-10-22 Last reviewed 2026-10-22 How we test

At a glance

  • Upscaling interpolates: it estimates pixels between the ones that exist. Nothing new is recovered.
  • Measuring a hard edge enlarged 4x: nearest and bilinear produced no overshoot, bicubic overshot by 10 levels out of 255 on each side, Lanczos by 15.
  • That overshoot is the bright halo people notice along high-contrast edges after enlarging.
  • Nearest-neighbour is the wrong choice for photographs at any size: it leaves visible blocks and, when you later shrink the result, moire.
  • Enlarging a heavily compressed image enlarges its artefacts too, which is why some files look worse than their pixel count suggests.

What "upscaling" means

When you enlarge an image, the software has to decide what colour the new pixels should be. It has no new information, so it estimates: each new pixel is a weighted average of the old ones around it, and the weights are the filter. Nearest-neighbour copies the closest pixel; bilinear blends the nearest four; bicubic and Lanczos use wider kernels with negative lobes that sharpen the transition.

That last detail is where the trouble comes from. A filter with negative lobes can produce a value beyond the range of its neighbours — brighter than the brightest pixel at the edge, darker than the darkest. On a hard boundary between light and dark, you get a thin bright rim on one side and a dark rim on the other. It is not a bug; it is the arithmetic that makes an interpolated edge look crisp instead of mushy.

Measuring it

We took a 400 x 400 image containing a hard vertical edge — one half at level 90, the other at 220 out of 255 — and enlarged it four times to 1600 x 1600 filter, then measured how far the result overshot the original values.

Filter Overshoot past 220 Undershoot below 90 Total deviation Visible result
NEAREST 0 0 0 Blocky steps along diagonals
BILINEAR 0 0 0 Soft, slightly blurry edge
BICUBIC 10/255 10/255 Faint halo, sharper edge
LANCZOS 15/255 15/255 30 Clear halo, sharpest local contrast
Upscaling a hard edge 4x: ringing produced by each method 0 8 17 25 34 0 NEAREST 0 BILINEAR 20 BICUBIC 30 LANCZOS ringing overshoot beyond the edge (0-255 scale) levels
Ringing produced when a hard edge is enlarged 4x. Zero is smoother, not better: the filters that ring are also the ones that keep an edge looking like an edge.

An overshoot of 10 to 15 levels out of 255 is a 4-6% deviation — faint, but visible on a straight high-contrast boundary such as a horizon against a bright sky, a dark window frame, or lettering on a coloured background. If you have ever enlarged a logo or a screenshot and seen a pale outline appear around dark shapes, this is the mechanism. It is also why enlarging, then sharpening with an unsharp mask, quickly produces something worse than what you started with: the two effects add up.

Why nearest-neighbour looks wrong on photographs

Nearest-neighbour does not interpolate at all. Each new pixel simply copies the nearest original, which means large areas of the enlarged image repeat the same value in square blocks. On a photograph this reads as blockiness along every diagonal and curve. Worse, the blockiness interacts with any later resize: shrink that image again and the repeating blocks turn into moire patterns that were never in the original, exactly as measured in the shrinking half of our resizing study, where nearest-neighbour left 6.85 of residual noise in a flat area against 1.18 for bilinear.

Nearest-neighbour does have one correct use: pixel art, sprite sheets and screenshots of pixel-based user interfaces, where each source pixel is meant to become a square block rather than a gradient.

What learned or "AI" upscalers add

Classical filters interpolate from the neighbouring pixels only. Learned upscalers are trained on large image sets to predict what fine detail usually looks like at higher resolutions: skin texture, foliage, fabric weave, lettering. On a good input, the results are noticeably better than bicubic, and for photographs of common subjects they can be convincing.

Two limits are worth knowing before you rely on them. First, the detail is plausible, not true — the model is inventing texture consistent with its training data, so an enlarged face can gain skin detail that was never in the photograph. That is unacceptable for evidence, identity documents or anything forensic, and risky for product photos where texture accuracy matters. Second, the models work best on clean, lightly compressed inputs; feed them a heavily compressed JPEG and they will confidently enlarge the compression artefacts along with everything else.

For documents, request a re-scan or the original file. For screenshots of text, look for a vector original or a PDF. For a photo you still have access to, re-take or re-download it. Upscaling is for the cases where none of those options exist.

When enlarging is acceptable, and by how much

Situation Verdict Reason
Photo enlarged up to 2x for screen viewing Fine At typical screen densities the softening is not visible
Photo enlarged 2-4x for print viewed in the hand Marginal Detail is invented; keep prints small or view from further away
Poster or large print viewed from 1.5 m or more Fine The eye cannot resolve the difference at that distance
Text, screenshots, line art Avoid Edges ring and letterforms distort; find a vector source instead
Passport or ID photo Avoid Many authorities reject digitally altered photos outright
Evidence, medical, insurance or forensic images Never Interpolated detail is fabricated detail

The rule of thumb we would give a friend: treat 2x as the practical ceiling for a photograph, treat anything beyond that as a compromise you may accept for a large poster and should not accept for a document.

How to enlarge an image well in a browser

  1. Start from the largest, least-compressed original you have. Each round of compression and each previous resize compounds.
  2. Resize once, in a single step, to the final dimensions. Repeated small enlargements stack artefacts, just as repeated shrinking does.
  3. Use bicubic or Lanczos (the resizer here uses a high-order filter at its highest quality setting). Choose bicubic when you want the least ringing, Lanczos when you want the crispest local contrast and can accept a slight halo.
  4. Sharpen lightly afterwards, if at all. A modest amount counters interpolation softness; a strong setting amplifies the haloes measured above.
  5. Do not enlarge, save, reopen and enlarge again. Save the final result once, in a lossless format if it still has to be edited, or as a high-quality JPEG if it is finished.

What cannot be recovered

No filter recovers detail that was never captured, and no amount of processing removes JPEG artefacts without removing real texture with them. If a file arrived through a chat app at 800 x 600 with visible blocking, the practical options are to find the original, take a new photo, or accept that the enlarged version will look soft and slightly dirty. Choosing the best filter changes how gracefully it degrades; it does not change what is in the file.

Resize, compress and convert images in your browser

Everything happens on your device — no upload, no account.

Open the image tools

Sources

  • Pillow resampling filters and behaviour — https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.resize
  • pica resampling library (filters used in the browser tools here) — https://github.com/nodeca/pica
  • Lanczos and bicubic kernels, ringing artefacts (ImageMagick usage notes) — https://imagemagick.org/Usage/resize/