Image Resizer โบ Guides
Enlarging a small image: what you gain, what you lose and how big the file gets
A form asks for a picture at least 1,200 pixels wide and yours is 600. A logo that looked fine in an email signature has to fill a slide. The usual fix is to enlarge the file, and the usual warning is that it will look soft. We wanted numbers for that warning, so we ran three tests in a browser resizer and measured what happened to edges, to fine detail and to the file size.
Short answer: enlarging adds pixels, not detail. A sharp edge gained 2 in-between pixels at 150 to 300%, 4 at 400% and 8 at 800%. Detail that was removed by shrinking did not come back when the small copy was enlarged again. A photo-like test image enlarged to 400% had 16 times the pixels, and its JPG was about 6 times the size with nothing new in it.
What enlarging does
An image file is a grid of coloured pixels. Enlarging to 200% makes a grid with twice as many columns and twice as many rows, so four times as many pixels. The original pixels can fill only a quarter of them. The rest have to be invented, and there are two common ways to do it.
- Smoothing fills each new pixel with a blend of its nearest original pixels. This is what browsers, phones and most editors do by default. Photos stay natural, but every sharp edge becomes a short ramp.
- No smoothing, often called nearest neighbour, copies the closest original pixel. Edges stay hard, and each original pixel becomes a visible square. It suits pixel art.
Neither method knows what the scene looked like between the original pixels. Both only rearrange what is already in the file.
What we measured
All tests ran in Chromium 153.0.8010.12 using the same steps as our image resizer: the image is decoded, drawn onto a canvas of the new size with smoothing set to high, and saved. JPG and WebP are saved at quality 0.92. Two of the results were also produced on the resizer page itself, and the downloaded files had exactly the same size in bytes as the test's files.
- Edge test. A 200 × 100 image, dark grey (32) on the left half and light grey (224) on the right, enlarged to 150, 200, 300, 400 and 800%. We counted the pixels across the edge that were neither 32 nor 224.
- Detail test. Images 1,200 pixels wide filled with dark and light vertical lines of one width, from 1 to 16 pixels. Each was shrunk to 50% or 25% and the small copy was enlarged back to 1,200 pixels. We compared the contrast of the lines before and after.
- File size test. A 1,000 × 750 photo-like picture (colour gradients, overlapping shapes, thin lines and light noise) and a 400 × 300 flat graphic (white background, two coloured shapes, two lines of text, a thin border), enlarged to 150, 200, 300 and 400% and saved as JPG, WebP and PNG.
Edges: a hard line becomes a ramp
In the original image the edge is one step: a pixel of 32 next to a pixel of 224. After enlarging with smoothing, extra pixels with in-between values appeared across the edge.
| Enlarged to | In-between pixels across the edge | Their values |
|---|---|---|
| 150% | 2 | 56, 188 |
| 200% | 2 | 80, 176 |
| 300% | 2 | 92, 152 |
| 400% | 4 | 56, 104, 152, 200 |
| 800% | 8 | 44, 68, 92, 116, 140, 164, 188, 212 |
The ramp gets longer as the enlargement grows, and that ramp on every edge is what people see as a blurry enlargement. Small text suffers first because its strokes are only a pixel or two wide. With smoothing switched off, the same edge had no in-between pixels at any size. No value in the enlarged edge images was darker than 32 or lighter than 224, so the smoothing did not add halos around the edge.
Detail: shrinking and enlarging again does not undo the loss
People often keep only the small copy of a picture and enlarge it when a bigger one is needed. The detail test shows what that costs. Contrast is given as a share of the original line pattern: 100% means the lines are as dark and light as before, 0% means they have merged into even grey.
| Line width in the original | Shrunk to 50%, enlarged back (%) | Shrunk to 25%, enlarged back (%) |
|---|---|---|
| 1 px | 0 | 0 |
| 2 px | 50.0 | 0 |
| 4 px | 79.1 | 55.9 |
| 8 px | 90.1 | 81.0 |
| 16 px | 95.2 | 90.9 |
The pattern is simple. Lines that shrink to half a pixel or less vanish completely: 1-pixel lines at 50%, and 1- and 2-pixel lines at 25%, became flat grey, and enlarging the grey gives more grey. Lines that are exactly one pixel wide in the small copy survive there at full contrast, but come back at about half strength after enlarging (50.0% and 55.9%). Only lines several pixels wide in the small copy return close to the original.
For a real picture this means hair, fabric weave, distant leaves and small print are the first things lost, and they stay lost. Keep the original file, and resize from it each time.
File size: many more bytes for the same picture
The pixel count grows with the square of the scale: 2.25 times at 150%, 4 times at 200%, 9 times at 300% and 16 times at 400%. The files grew more slowly than that, but they still grew a great deal. The table shows each enlarged file as a multiple of the same image saved at 100% in the same format.
| Enlarged to | Pixels | JPG | WebP | PNG |
|---|---|---|---|---|
| 150% | 2.25 | 1.51 | 1.43 | 2.00 |
| 200% | 4 | 2.12 | 1.70 | 3.22 |
| 300% | 9 | 4.25 | 3.44 | 6.65 |
| 400% | 16 | 5.95 | 4.23 | 10.28 |
At 100% the photo-like picture was 350 KB as JPG, 324 KB as WebP and 1,755 KB as PNG. At 400% it was 2,085 KB, 1,373 KB and 18,054 KB. The 400% JPG is about six times the size of the 100% file and shows the same picture with softer edges.
The flat graphic behaved the same way in JPG and WebP (5.26 and 3.83 times at 400%). In PNG it grew 11.31 times, from 12.5 KB to 141 KB. The reason is the ramps from the edge test: a flat graphic has few colours, which PNG stores very compactly, and smoothing adds many new in-between shades along every edge. The same graphic enlarged to 400% without smoothing was 56.7 KB, 4.55 times the original.
What this means in practice
- A site demands a minimum size. Enlarging can meet a rule about pixel dimensions. Go only as far as the rule requires, because every extra step adds softness and bytes. Save photos as JPG or WebP, not PNG.
- Printing. A printer needs a certain number of pixels per inch. Enlarging supplies the pixels but not the detail, so the print looks about as sharp as the small file printed large. If a sharper source exists, such as the camera original or a new scan at a higher resolution, use that.
- Logos and icons. Ask for the vector file (SVG, PDF, AI or EPS). A vector image is redrawn at any size with clean edges. Enlarging a small PNG logo is the case where softness shows most.
- Screenshots with small text. Take the screenshot again at a larger zoom or on a higher-resolution screen. Text strokes are too thin to enlarge well.
- Pixel art. Use an editor that offers nearest neighbour scaling, and enlarge by a whole multiple such as 200% or 400% so that every original pixel becomes a square of the same size.
- Showing an image larger on a web page. You do not need a bigger file. The browser enlarges the small file on screen in much the same way, so an enlarged copy only makes the page slower to load.
Limits of this test
The test covers one method: the smoothing a Chromium browser applies when a canvas is drawn at high quality. Other browsers and editors use different formulas and will give slightly different in-between values. Some editors add sharpening after enlarging, which raises edge contrast but can leave halos. Tools that rebuild detail with a trained model were not tested. Their output can look sharper, but the added detail is a guess about the scene, which matters for documents, faces and evidence. The test images were generated patterns, chosen because their detail can be measured exactly. Real photos vary, and their file sizes will not match these multiples.
The measurements are in three .csv files. edge.csv has one row per scale and smoothing setting, with the number and values of the in-between pixels and the darkest and lightest value in the row. shrink-then-enlarge.csv has one row per line width (1, 2, 3, 4, 6, 8, 12, 16, 24 and 32 pixels) and shrink size, with the contrast in the small copy and after enlarging back. file-size.csv has one row per image, scale and format, with the size in bytes, plus rows for the flat graphic enlarged without smoothing. Sizes on this page use 1 KB = 1,024 bytes.
Common questions
Can I enlarge an image without losing quality?
The enlarged image carries the same detail spread over more pixels, so nothing is added and edges look softer at the larger size. The only way to get more real detail is a source with more real pixels.
Does saving at a higher resolution or DPI make a picture sharper?
No. DPI is a note in the file that tells a printer how large to print the existing pixels. Changing it, or enlarging the pixel grid, does not add detail.
Why is my enlarged PNG so much bigger?
There are more pixels, and smoothing creates new in-between shades along every edge that PNG has to store exactly. In our test the PNG of a flat graphic enlarged to 400% was about 11 times the size. For photos, use JPG or WebP.
Is it better to enlarge in one step or in several small steps?
One step from the original where possible. Each extra step blends pixels that were already blended, and each extra JPG or WebP save discards a little more information.
How far can I enlarge before it looks bad?
It depends on the picture and on how closely it is viewed. In the edge test, 150 to 300% added two soft pixels per edge, 400% added four and 800% added eight. Photos of large, smooth subjects tolerate more than pictures with text or fine patterns.
References
- MDN: CanvasRenderingContext2D.imageSmoothingQuality
- MDN: CanvasRenderingContext2D.imageSmoothingEnabled
- HTML Standard: image smoothing in the 2D canvas
- MDN: CSS image-rendering
Figures without a source link come from the steps shown on this page. Companion tool: Image Resizer. Spotted an error? Write to help@glowhalo.org. Chromium, Edge and Pixel are trademarks of their owners; GlowHalo is not affiliated with them.