Menu

Image Resizer

Image Resizer: How It Works

Resizing an image sounds like one operation and is really three decisions: the target dimensions, what happens to the aspect ratio, and which resampling method redraws the pixels. Each affects how the result looks.

Preserve the aspect ratio

Aspect ratio is width divided by height. Change one dimension without the other and the image stretches — instantly obvious on faces and circles, and the most common resizing mistake.

To fit a target width, compute the factor and apply it to both: a 3000 × 2000 image resized to 1200 wide has a factor of 0.4, giving 1200 × 800.

When an image must fill a fixed frame of a different ratio, crop rather than stretch. Cropping loses content at the edges; stretching distorts everything.

Upscaling loses quality

Reducing an image discards information; enlarging one must invent it. Traditional resampling interpolates between existing pixels, which produces softness rather than detail — the information was never captured.

Machine-learning upscalers do better by predicting plausible detail from training data, but they are generating rather than recovering. For anything evidential or precise, treat upscaled detail with suspicion.

Resampling methods

MethodCharacterBest for
Nearest neighbourHard edges, blockyPixel art, where blockiness is intended
BilinearFast, slightly softQuick previews
BicubicSharper, good general qualityPhotographs — the usual default
LanczosSharpest, occasional ringingLarge reductions of detailed images

For large reductions — more than about half — resizing in two or three steps often gives a cleaner result than one large jump, because each step has more source pixels to average from.

Sizes worth knowing

UseDimensions
Open Graph / social preview1200 × 630
YouTube thumbnail1280 × 720
Instagram square / portrait1080 × 1080 / 1080 × 1350
Full-width web hero1920 wide
Blog body image800–1200 wide
Favicon32 × 32 and 180 × 180

High-density displays

A screen at 2× device pixel ratio needs an image roughly twice the CSS display width to look sharp. An image shown at 400 CSS pixels should be around 800 pixels wide. Going beyond 2× yields no visible improvement on almost any display and simply wastes bandwidth.

The better approach is responsive images — a srcset offering several sizes so the browser picks what the device actually needs, rather than sending one large file to everyone.

Work from the original

Always resize from the highest-resolution source you have. Resizing an already-resized image compounds quality loss, and with lossy formats it compounds compression artefacts too. Keep originals; export derivatives.

Frequently Asked Questions

How do I resize without distorting the image?
Change both dimensions by the same factor. To reach a target width, divide it by the original width and apply that factor to the height. When an image must fill a differently shaped frame, crop rather than stretch.
Can I enlarge an image without losing quality?
Not really. Enlarging must invent information that was never captured, so traditional methods produce softness. Machine-learning upscalers predict plausible detail, but they are generating it rather than recovering it.
What size should web images be?
About twice the CSS display width for sharpness on high-density screens — an image shown at 400 pixels should be around 800 wide. Beyond 2× there is no visible gain and a real bandwidth cost.
Which resampling method is best?
Bicubic for general photographic work, and Lanczos for large reductions of detailed images. Nearest neighbour only for pixel art, where preserving hard blocky edges is the intent.
Should I resize before or after compressing?
Resize first, then compress. Resizing removes the bulk of the data, and compressing afterwards optimises what remains. Doing it the other way wastes effort compressing pixels you are about to discard.
Are my images uploaded when I resize them here?
No. Resizing runs in your browser using its own canvas APIs, so the files never leave your device.

Related Image Tools

Browse all Image tools →