Resizing images without blur: pixels, percentages and print sizes
Resize once, from the original, to the pixels you will actually display. Print size is pixels divided by DPI — the file has no DPI of its own.
NoUpload engineering teamLast updated
Key facts
- The resizer halves the image repeatedly while both sides remain at least twice the target, then does the final scale.
- It never enlarges: an image already narrower than the target is left untouched, and percentage mode is clamped to 1–100.
- Print size is pixels ÷ DPI. A 6×4 inch photo at 300 dpi needs 1800×1200 pixels; an A4 page at 300 dpi needs 2480×3508.
Resizing sounds like the simplest operation in image editing: make the numbers smaller. It is also where a lot of images quietly turn to mush, because the cheap implementation — draw the whole image into a smaller canvas in one step — throws away pixels faster than it can average them.
The resizer does something slightly different, and the difference is visible on any image with fine detail.
Why one big step looks worse than several small ones
When you downscale 4000 pixels to 800 in a single drawImage, the browser samples a sparse grid of source pixels and writes each result from very few inputs. Fine patterns — fabric, hair, roof tiles, text — alias into moiré and jaggies because there is not enough averaging.
Halving repeatedly is the classic fix. Each step averages a 2 × 2 neighbourhood, so detail is filtered out gradually instead of skipped. The tool keeps halving while both dimensions are still at least twice the target, then does the final scale. For a 4000 → 800 resize that is roughly two halving steps plus a final 1000 → 800.
This is not a magic filter, and it is not “AI upscaling”. It is the boring, correct way to downsample, and it is why a resized photo looks crisp instead of crunchy.
What the tool will not do
- It never enlarges. If an image is already smaller than the target width, it is left exactly as it is. Upscaling adds no detail; it only makes the file bigger and softer. percent mode is clamped to 1–100 for the same reason.
- It never stretches. You set a width (or a percentage); the height is calculated from the original aspect ratio. There is no separate width × height box, because silent distortion is the most common way a bulk resize ruins a folder of photos.
- It does not crop. If you need an exact square or a specific box, resize by the limiting dimension and crop afterwards. Cropping is a separate decision from resizing, and merging them into one control is how faces get cut off.
Pixels are the file; DPI is a print instruction
A JPEG does not contain “300 dpi”. It contains pixels. DPI is a number a layout program uses to decide how large to print those pixels:
print size in inches = pixels ÷ dpi
| Pixels on the long edge | At 300 dpi | At 150 dpi | At 72 dpi |
|---|---|---|---|
| 1200 | 4 in / 10 cm | 8 in / 20 cm | 16.7 in / 42 cm |
| 2400 | 8 in / 20 cm | 16 in / 41 cm | 33 in / 85 cm |
| 3600 | 12 in / 30 cm | 24 in / 61 cm | 50 in / 127 cm |
So “resize for print” means deciding a physical size and a quality bar, then multiplying:
- A 6 × 4 inch photo at 300 dpi needs 1800 × 1200 pixels.
- An A4 page at 300 dpi needs 2480 × 3508 pixels.
- An A4 page at 150 dpi needs 1240 × 1754 — fine for a handout, soft for a photo book.
The JPG to PDF guide covers the other direction: what happens to those pixels when a PDF page is sized in points.
Choosing a width for the web
Work backwards from the display slot, not from the camera:
| Where it appears | CSS width | 1× file | 2× file |
|---|---|---|---|
| Card thumbnail | 380 px | 380 | 760 |
| Article image | 720 px | 720 | 1440 |
| Full-width hero | 1400 px | 1400 | 2800 |
| Email header | 600 px | 600 | 1200 |
For most sites, serving the 1× file to everyone wastes sharpness on retina screens, and serving 2× to everyone doubles bandwidth for no benefit. The practical compromise is a single file at about 1.5× the CSS width, or srcset if the site supports it. The size targets guide goes into the byte budgets for each case.
Two special cases:
- Email is not the web. Outlook and older clients may not respect responsive widths, and a 2800-pixel image bloats the message. 600–1200 pixels is the safe range.
- Official photo uploads are specified in exact pixels, not “roughly”. A passport or visa photo has a fixed pixel box and a head-height rule; the passport photo tool checks both, and the digital size guide explains the byte limits.
What happens to quality and metadata
Resizing decodes the image, resamples it, and re-encodes it:
- Default quality is 88 in resize mode — high enough that the re-encode is not the visible problem; the resample is doing the real work.
- Format is kept for PNG, JPEG and WebP. AVIF and HEIC inputs are saved as WebP, because those formats are not universally accepted as output.
- PNG stays lossless, so a resized screenshot loses no detail beyond the pixels you removed — but it can still be large.
- Metadata does not survive. EXIF, GPS, camera data and colour profiles are dropped by the canvas round trip. Orientation is applied before resizing, so phone photos stay upright even though the orientation tag is gone.
Batch behaviour
Every file is processed independently, with its own aspect ratio and its own decision about whether it is already small enough. A batch of mixed landscape and portrait photos resized to “max 1920 px” produces files with different heights, all within the limit. That is the correct behaviour for a gallery; it is the wrong behaviour if you needed a uniform grid, which is a crop problem.
Download files individually, or take the ZIP when the batch is large.
The short version
- Start from the original, not from an already-resized copy.
- Pick pixels from the display size, not from the camera’s megapixel count.
- Resize once, then compress if the bytes still matter.
- Check the result at 100% for aliasing on fine patterns, and at display size for everything else.
The resize runs in a worker in the tab. Files are read from disk and written back; there is no upload step.
Questions this guide answers
Does resizing an image reduce quality?
Any downscale discards pixels, but the halving steps average detail gradually instead of skipping it, which avoids the aliasing of a one-shot canvas resize. Re-encoding defaults to quality 88, high enough that the resample is the visible factor, not the codec.
Can I resize to an exact width and height?
No, by design. You set a width or a percentage and the height follows the aspect ratio; there is no stretch or crop control. For an exact box, resize by the limiting dimension and crop afterwards.
What DPI should I set when resizing?
None. A JPEG or PNG has pixels, not DPI; the DPI field only tells layout software how large to print them. Decide the physical size and quality bar, multiply to get pixels, and ignore the metadata.