Image Upscaling, Explained

After reading this you will know how enlarging an image actually works, why Lanczos resampling suits photos and Scale2x suits pixel art, and how to judge whether an upscale looks good or just looks big.

What upscaling really does

An image is a grid of pixels. A 400x300 photo holds 120,000 color samples. When you upscale it 2x to 800x600, the new grid has 480,000 pixels, four times as many. The camera never recorded those extra 360,000 samples, so the computer has to invent them from the ones it has.

That inventing step is called resampling. Every upscale answers one question repeatedly: given the known pixels around this new empty position, what color belongs here? The differences between upscalers are entirely in how they answer that question.

Here is the hook. Take a single pixel at position (10, 10) in the small image. After a 2x enlargement it does not simply become a pixel at (20, 20). Instead the new grid asks for colors at (20, 20), (21, 20), (20, 21) and so on, and each of those falls between the original samples. The upscaler estimates each one. A good estimate keeps edges sharp. A poor one smears them.

When to use each method

The right algorithm depends on the source, not on the size you want.

Lanczos resampling
Best for photographs, scans and any image with smooth gradients. It blends nearby pixels with a weighting curve, so it reconstructs soft transitions without hard blockiness.
Scale2x and Scale3x
Best for pixel art, sprites, low-resolution game graphics and simple line icons. These algorithms look at the shape of each pixel's neighbors and keep straight edges straight instead of blurring them.

Use Lanczos on a family snapshot. A 2x enlargement of a face stays natural because skin, hair and sky are all smooth. Use Scale2x on a 32x32 game sprite, because Lanczos would turn its crisp black outline into a gray haze.

No upscaler adds real detail. If text in the original is too small to read, a 4x enlargement makes the blur bigger, not the text sharper. Resampling produces the cleanest interpolation of what was captured, nothing more.

The math behind Lanczos

Lanczos resampling weights each nearby source pixel by a windowed sinc function. For a scaling factor, each output pixel maps back to a fractional position in the source, and pixels within a radius a contribute according to this kernel.

L(x) = \begin{cases} \text{sinc}(x)\,\text{sinc}(x/a) & \lvert x \rvert \lt a \\ 0 & \lvert x \rvert \ge a \end{cases}

Here x is the distance from the output sample to a source pixel, measured in source pixels. The term \text{sinc}(x) = \sin(\pi x)/(\pi x) is the ideal interpolation shape, and \text{sinc}(x/a) is the window that limits how far the influence spreads. The radius a is usually 2 or 3. With a = 3, six source pixels along each axis feed every output pixel.

The key feature is that L(x) goes negative for some distances. A pixel one unit past the center gets a small negative weight. Those negative lobes are what sharpen edges: a bright pixel next to a dark one pulls its neighbor slightly darker, which keeps the boundary crisp instead of washed out. Bilinear interpolation, by contrast, uses only positive weights and always blurs.

How Scale2x decides

Scale2x turns each source pixel into a 2x2 block of four output pixels. It does not average anything. Instead it compares the four orthogonal neighbors (up, down, left, right) and chooses each of the four output pixels based on whether an edge runs diagonally through the corner.

Call the center pixel C, with neighbors A (up), B (right), D (left), F (down). The top-left output pixel becomes D if D == A and D != F and A != B, otherwise it stays C. The other three corners follow the same rule rotated. The effect is that a diagonal line in the source becomes a smoother staircase without any new colors appearing. Every output pixel is an exact copy of some input pixel, so the palette never changes and the art never blurs.

A worked example

Enlarging a 400x300 photo 2x with Lanczos

This reproduces the calculator defaults: a 400x300 source, factor 2x, Lanczos with sharpening on.

  1. New width is 400 x 2 = 800. New height is 300 x 2 = 600.
  2. Pixel count grows from 400 x 300 = 120000 to 800 x 600 = 480000, a factor of four.
  3. Output pixel (401, 301) maps back to source position (200.5, 150.5), exactly between four originals.
  4. With radius a = 3, the 36 nearest source pixels each get a Lanczos weight. The weights sum to 1 after normalization, so brightness is preserved.
  5. Because 200.5 sits halfway between columns 200 and 201, those two columns dominate the horizontal blend, and the negative lobes from columns 198 and 203 add the edge contrast.

The result is a 480,000 pixel image whose smooth areas look natural and whose edges stay defined. The file will be roughly four times larger in raw pixels, though final byte size depends on compression.

The weight peaks at 1 for the pixel directly under the sample, then dips below zero near distance 0.75. Those negative dips create edge sharpness.

Comparing methods on the same image

The table shows how a 200x200 source behaves under different factors and methods. Pixel counts are exact; sharpness is a qualitative note.

Output size and character by method
MethodFactorOutputOutput pixelsBest source
Lanczos2x400x400160000photos
Lanczos4x800x800640000photos
Scale2x2x400x400160000pixel art
Scale3x3x600x600360000pixel art

Notice that Lanczos 2x and Scale2x 2x produce the same 160,000 pixels. The size is identical; only the pixel values differ. On a photo Scale2x would leave visible steps, and on a sprite Lanczos would leave visible blur.

On a smooth photo, Lanczos gives clean gradients while nearest-neighbor gives blocky steps. On a sprite, Scale2x keeps a hard black outline while Lanczos softens it into gray. The right choice always follows the source type.

Common mistakes

The first mistake is expecting sharp detail from a blurry source. Upscaling a 640x480 webcam frame to 2560x1920 gives you 4x the pixels and the same softness. The blur simply covers more screen area.

The second mistake is using Lanczos on pixel art. A 16x16 icon upscaled 4x with Lanczos has 4096 output pixels, but its clean edges dissolve into anti-aliased fuzz. Scale2x twice, or Scale2x then Scale2x again, keeps every edge sharp.

The third mistake is stacking upscales to chase quality. Going 2x then 2x is not the same as 4x once. Each pass reinterpolates already-interpolated pixels, so errors compound. Do the full enlargement in one step when you can.

The fourth mistake is ignoring file size. Four times the pixels usually means a much larger file. After upscaling, run the result through the Image Compressor to trade a little quality for a smaller download.

Sharpening after Lanczos helps mild softness but never restores lost detail. If you turn sharpening too high, thin edges gain bright halos. Keep it moderate and judge on a real photo, not on text.

Related tools

Upscaling is one step in a wider workflow. To change dimensions without enlarging, or to fit an exact target, use the Image Resizer. To trim before or after, the Aspect-Ratio Crop locks to presets like 1:1 and 16:9. If your upscaled art is destined for a browser tab, the Favicon Generator produces every required size from a single source. Your images stay in the browser and are never uploaded.

Frequently asked questions

Why does my upscaled photo still look soft?

Because the detail was never captured. Lanczos reconstructs a clean version of the samples you have, but it cannot recover frequencies the sensor did not record. A 4x enlargement of a soft photo is a bigger soft photo.

Is Scale2x better than Lanczos?

Only for pixel art. Scale2x copies exact pixel values and preserves hard edges, which is exactly wrong for photographs, where you want smooth blending. Match the method to the source: Lanczos for photos, Scale2x for sprites.

What factor should I choose?

The smallest that meets your need. Each doubling quadruples the pixel count, so 4x on a 1000x1000 image produces 16 million pixels. Larger is not sharper; it only spreads the existing detail across more pixels.

Can I upscale to any exact width?

This tool works in whole multiples (2x, 3x, 4x). For an arbitrary target like 1180 pixels wide, upscale to the nearest multiple first, then use the Image Resizer to hit the exact number.

Will upscaling change the colors?

Lanczos can shift a pixel slightly because of its negative-weight edge sharpening, and very bright or dark values may clip. Scale2x never changes colors at all, since every output pixel is a copy of a source pixel.