← All articles 9 min read

How to Resize an Image Without Losing Quality

Resizing an image always involves a trade-off. You are asking software to invent or discard pixel data, and that process is inherently lossy. But the visible quality loss ranges from imperceptible to catastrophic depending on the direction of the resize, the algorithm used, the file format, and the order of operations.

This guide covers exactly what happens when pixels get recalculated, which approaches minimize damage, and how to set up a workflow that keeps your images sharp.

Why Resizing Loses Quality

Every digital image is a grid of pixels. When you change the dimensions of that grid, the software must figure out what color each new pixel should be. This process is called resampling.

Three things degrade quality during a resize:

  1. Interpolation artifacts. The algorithm estimates new pixel values by blending neighbors. Cheap algorithms produce blurry or jagged results. Better algorithms produce sharper output but cost more computation.
  2. Information loss. Downscaling a 4000×3000 image to 800×600 discards roughly 95% of the pixel data. That information is gone permanently — you cannot recover it by scaling back up.
  3. Compression artifacts. If you save the resized image as JPEG or WebP, the lossy encoder introduces its own artifacts on top of the resampling artifacts. Resizing and compressing in the same step compounds the damage.

The good news: with the right algorithm, format, and workflow, you can make the quality loss invisible to the human eye.

Downscaling vs. Upscaling

The direction of your resize determines how much quality you can preserve.

Downscaling (making smaller) Upscaling (making larger)
What happens Pixels are merged/discarded New pixels are invented
Quality risk Low — extra data is averaged out High — the algorithm is guessing
Typical result Sharp, often looks better than the original at display size Blurry, soft, or shows visible artifacts
Best approach Use Lanczos or bicubic resampling Avoid if possible; use AI upscaling as a last resort
Safe ratio Any reduction works well Beyond 2× starts looking obviously synthetic

The rule: always start from the largest source image you have. Downscaling is a solved problem. Upscaling is damage control.

Resampling Algorithms Compared

Not all resize algorithms are equal. Here is what the four most common options actually do, and when each one makes sense.

Algorithm How It Works Quality Speed Best For
Nearest Neighbor Copies the closest pixel value, no blending Lowest — blocky, jagged edges Fastest Pixel art, retro graphics, integer scaling (2×, 3×)
Bilinear Averages 4 neighboring pixels with linear weighting Moderate — smooth but slightly soft Fast Quick previews, thumbnails where speed matters
Bicubic Averages 16 neighboring pixels with cubic weighting Good — sharper edges, slight halo possible Moderate General-purpose photo resizing, good default choice
Lanczos Uses a sinc-based filter over a wider neighborhood (typically 3-lobe) Best — sharpest edges, preserves fine detail Slowest High-quality photo resizing, print preparation, archival work

For photographs and product images, Lanczos is the right default. The speed difference is negligible on modern hardware — we are talking milliseconds, not minutes. The quality difference is visible, especially on images with fine text, sharp edges, or repeating patterns.

Pixotter's resize tool uses Lanczos resampling via wasm-vips, running entirely in your browser. No upload, no server round-trip, and the algorithm choice is already optimized.

Format Matters: Resize First, Compress After

One of the most common mistakes is resizing an already-compressed JPEG. Here is why that hurts:

  1. JPEG decoding reconstructs an approximation of the original (compression artifacts are baked in).
  2. The resize algorithm resamples those already-degraded pixels.
  3. Re-encoding as JPEG introduces a second round of compression artifacts.

Each generation of JPEG compression makes the image measurably worse. This is called generation loss, and it compounds.

The better workflow:

  1. Start from the highest-quality source — RAW, TIFF, or PNG.
  2. Resize in a lossless format (PNG or TIFF). No compression artifacts contaminate the resampling.
  3. Convert to your target format (JPEG, WebP, AVIF) after resizing and as the final step.
  4. Apply lossy compression only once, at the end.

If your only source is a JPEG, you cannot undo the existing artifacts. But you can prevent adding new ones by resizing at the decoded pixel level and encoding to the target format only once. Pixotter handles this automatically — the conversion tool processes decoded pixel data regardless of input format.

For a deeper look at the trade-offs between compression types, see our guide on lossy vs. lossless compression.

Step-by-Step: Resize with Pixotter

Pixotter processes images client-side using WebAssembly (wasm-vips with Lanczos resampling). Your images never leave your browser.

  1. Open pixotter.com/resize.
  2. Drop your image onto the upload zone (or click to browse). Supports PNG, JPEG, WebP, AVIF, TIFF, and GIF.
  3. Enter your target dimensions. Lock the aspect ratio toggle to prevent stretching.
  4. Click Resize. Processing happens locally — a 20MP photo typically completes in under a second.
  5. Preview the result. If you also need compression or format conversion, add those operations to the pipeline before downloading.
  6. Download the resized image.

Because everything runs client-side, there is no file size limit imposed by a server upload. Your browser's available memory is the only constraint, which means images over 100MP work fine on most modern machines.

Best Practices for Quality Preservation

These rules apply regardless of which tool you use:

Special Case: Retina and HiDPI Displays

Retina displays (2× pixel density) render one CSS pixel using four physical pixels. If you serve a 600×400 image in a 600×400 CSS container on a retina screen, it will look soft.

The fix: serve images at 2× the display dimensions and let CSS constrain the rendered size.

<!-- Display size: 600×400. Serve 1200×800 for retina sharpness. -->
<img src="hero-1200x800.webp" width="600" height="400" alt="Product photo">

This means your resize target for web images is often 2× the CSS layout size, not the layout size itself. Factor this into your workflow — resize from your full-resolution original to the 2× target, skip the 1× version entirely.

For responsive images serving multiple resolutions, use srcset:

<img
  src="hero-800.webp"
  srcset="hero-800.webp 800w, hero-1200.webp 1200w, hero-1600.webp 1600w"
  sizes="(max-width: 600px) 100vw, 600px"
  alt="Product photo"
>

Understanding image resolution and DPI helps you calculate the right target dimensions for any display context. And if you need to adjust DPI metadata specifically, our guide on changing image DPI covers that workflow.

Special Case: Batch Resizing

When you have dozens or hundreds of images to resize — product catalogs, social media assets, photo galleries — manual resizing is not an option.

Pixotter batch mode: Drop multiple images onto pixotter.com/resize and apply the same target dimensions to all of them. Same client-side processing, same Lanczos quality, no per-image server cost. For a detailed walkthrough, see our batch resize guide.

CLI with ImageMagick 7.1 (Apache-2.0 license): For scripted pipelines or CI/CD integration, ImageMagick's mogrify command handles batch resizing efficiently:

# ImageMagick 7.1 — resize all PNGs in a directory to 1200px wide, preserving aspect ratio
magick mogrify -filter Lanczos -resize 1200x -path ./resized *.png

Key flags:

For automated pipelines running on a server, ImageMagick 7.1 is the standard. For one-off batch jobs where you do not want to install anything, Pixotter in the browser gets it done.

When Upscaling Is Unavoidable

Sometimes the only source image you have is too small. A client sends a 400×300 logo and needs it at 1600×1200. Traditional resampling algorithms will produce a blurry, unusable result at that 4× magnification.

AI-based upscaling tools use trained neural networks to intelligently generate new pixel detail. They do not recover the original information — they hallucinate plausible detail based on patterns learned from millions of images. The results can look impressive, but they are synthetic.

Real-ESRGAN v0.2.5 (BSD-3-Clause license, free and open source): State-of-the-art for photographic upscaling. Works well up to 4× on photographs and illustrations. Results degrade on text-heavy images and diagrams. Runs locally via command line or through various GUI wrappers.

# Real-ESRGAN v0.2.5 — upscale 4× using the general photo model
realesrgan-ncnn-vulkan -i input.png -o output.png -n realesrgan-x4plus -s 4

Topaz Photo AI (proprietary, paid — starts at $199): Commercial option with face-specific and text-specific models that handle more edge cases than Real-ESRGAN. Integrates with Lightroom and Photoshop. Worth evaluating if upscaling is a regular part of your workflow and the budget allows it.

Honest limitations of AI upscaling:

The best strategy remains: avoid needing to upscale by sourcing the highest-resolution original available.

FAQ

Does resizing an image reduce file size?

Downscaling reduces pixel count, which directly reduces file size. A 4000×3000 JPEG at 2.5MB might be 150KB at 800×600. The exact reduction depends on the content complexity and output format. For maximum file size reduction, resize first, then compress as a separate step.

What is the best format for resizing without quality loss?

PNG and TIFF are lossless — no compression artifacts during the resize workflow. Resize in PNG, then convert to WebP or JPEG for delivery. TIFF handles wider color spaces (useful for print) but creates larger files. For web workflows, PNG is the practical choice.

Can I resize a JPEG without losing more quality?

You can minimize additional loss but not eliminate it entirely. Decode the JPEG, resize the pixel data using Lanczos, and encode once to your target format. Avoid re-encoding as JPEG multiple times. Each encode/decode cycle accumulates artifacts.

What dimensions should I use for web images?

For full-width hero images: 1600–2400px wide (serving retina at 800–1200px CSS width). For content images: 800–1200px wide. For thumbnails: 300–400px wide. Always serve the smallest size that looks sharp at the display dimensions, accounting for 2× retina.

Is Lanczos always the best resampling algorithm?

For photographs, yes. For pixel art and retro graphics, Nearest Neighbor is better — it preserves hard pixel edges without blending. For quick previews where speed matters more than quality, Bilinear is fine. But for any image where quality matters, Lanczos is the correct default.

Does changing DPI affect image quality?

Changing DPI metadata alone (without resampling) changes nothing about the pixel data. It only affects how printers interpret the physical size. A 300 DPI and 72 DPI version of the same image are pixel-identical if the dimensions stay the same. Quality loss only happens when pixels are added or removed. See our DPI guide for the full explanation.

How do I resize images for email without quality loss?

Most email clients display images at 600–700px wide maximum. Resize to 600px wide using Lanczos, save as JPEG at quality 80–85 or WebP at quality 80. This keeps file size under 100KB for fast loading while maintaining sharp detail at the display size. Avoid PNG for photographic email images — the file size is unnecessarily large.

Why does my resized image look blurry?

Three common causes: the image was upscaled (pixels were invented), a low-quality algorithm like Bilinear was used when Lanczos would be better, or the image was resized to smaller-than-display dimensions and the browser is scaling it back up. Check that your output dimensions match or exceed the actual display size, and verify your tool is using Lanczos or bicubic resampling.