Blog
Pixels Aren't Inches: What Resizing an Image Actually Does
Resampling algorithms, aspect-ratio math, and why upscaling an image has hard limits no software can get around.
A photo that's 4000 pixels wide isn't "4000 inches" of anything. It's a grid — 4000 columns by however many rows — where each cell holds one color value. Resizing that image to 800 pixels wide doesn't shrink the photo the way folding a piece of paper shrinks it; it builds a brand new, smaller grid and has to decide, for every one of its cells, what color goes there. That decision process is where almost all the interesting (and occasionally ugly) behavior of image resizing comes from.
The grid has to be rebuilt, not just trimmed
Going from 4000 pixels wide to 800 pixels wide is a 5:1 reduction. There is no clean way to map five old pixels onto one new pixel and just pick one — you'd be throwing away four-fifths of the image's information based on an arbitrary choice of which pixel survives. Every practical resizing method instead computes some kind of average or weighted blend of the source pixels that land near each new pixel's position. The exact math of that blend is called the resampling algorithm, and different algorithms trade speed for smoothness in different ways.
Nearest, bilinear, bicubic: three answers to the same question
Nearest-neighbor resampling is the crudest option: for each new pixel, look at the source grid, find the single closest old pixel, and copy its color directly. It's fast and it's the only method that never invents new colors, which is why it's still the right choice for pixel art — resizing a 16x16 game sprite with anything smoother turns its crisp edges into a blurry mess. For photographs, though, nearest-neighbor produces jagged, blocky results because it ignores everything except one sample point per output pixel.
Bilinear resampling improves on this by blending the four nearest source pixels, weighted by distance, for each output pixel. It's a reasonable middle ground — smoother than nearest-neighbor, cheap to compute — but it can still look a little soft, especially around hard edges like text or line art. Bicubic resampling goes further, sampling a 4x4 neighborhood (16 source pixels) and fitting a curve through them rather than a straight-line blend. It produces noticeably sharper, more natural-looking results for photographic content, at the cost of more computation. Most consumer image tools, including browsers' own canvas APIs, default to something in the bilinear-to-bicubic range because it's the best general-purpose tradeoff for photos.
Aspect ratio is a ratio, not a suggestion
An image's aspect ratio is just width divided by height — a 4000x3000 photo has a ratio of 4:3. Resize it to 800 pixels wide while keeping that ratio and the height must become exactly 600, because 800/600 also reduces to 4:3. Type in 800x800 instead and you're not resizing anymore, you're distorting: every circle becomes an oval, every face gets stretched. This is why most resize interfaces lock width and height together by default and require an explicit unlock — it's less a UI convenience and more a guardrail against a math mistake that's very easy to make by hand. If you need a specific pixel dimension that doesn't match the source ratio, the honest options are cropping to that ratio first or padding the extra space with a background color, not stretching.
Why upscaling has a ceiling
Shrinking an image discards information; enlarging it has to invent information that was never captured. Take that same 800x600 image and blow it up to 4000x3000 and the resampling algorithm is now guessing what detail should exist between pixels that used to be adjacent. Bicubic and similar algorithms do this by interpolation — essentially smooth guessing based on neighboring values — and the result is a bigger image, but not a more detailed one. Edges soften, fine texture turns to mush, and text that was already slightly blurry becomes unreadable. This is a hard mathematical limit, not a software shortcoming: no traditional resampling method can recover detail that was never sampled in the first place.
AI upscalers (sometimes called super-resolution models) work differently — they're trained on huge datasets of low-resolution and high-resolution image pairs and learn to hallucinate plausible detail rather than interpolate it. That can look impressive, but "plausible" is the operative word: the added detail is a statistical guess, not a recovery of the original scene. For most everyday resizing needs — fitting a photo to a website's layout, shrinking an image for email, matching a required upload dimension — none of this matters, since you're almost always sizing down, where the math is well-behaved and the results are predictable. It matters the moment you try to make a small thumbnail into a print-quality file, which is the one direction resizing math can't fully deliver on.
Knowing which direction you're resizing in — and by how much — is really the whole story. A modest downscale from a phone photo to a web-friendly width will look identical under nearly any algorithm. A 10x upscale will look rough no matter which one you pick. TheResize Image tool on this site handles the pixel math and aspect-ratio locking automatically, but it's worth knowing what's happening underneath when a result doesn't look the way you expected.
