Image Resizer โ€บ Guides

Enlarging a small image: what you gain, what you lose and how big the file gets

Open the tool: Image Resizer

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.

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.

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 toIn-between pixels across the edgeTheir values
150%256, 188
200%280, 176
300%292, 152
400%456, 104, 152, 200
800%844, 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.

Shrunk to 50%, enlarged backShrunk to 25%, enlarged back1 px002 px5004 px79.155.98 px90.18116 px95.290.9
Line contrast left after shrinking and enlarging back (%) โ€” chart drawn from the table below.
Line width in the originalShrunk to 50%, enlarged back (%)Shrunk to 25%, enlarged back (%)
1 px00
2 px50.00
4 px79.155.9
8 px90.181.0
16 px95.290.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.

JPGWebPPNG150%1.511.432200%2.121.73.22300%4.253.446.65400%5.954.2310.28
Photo-like picture: file size as a multiple of the 100% file โ€” chart drawn from the table below.
Enlarged toPixelsJPGWebPPNG
150%2.251.511.432.00
200%42.121.703.22
300%94.253.446.65
400%165.954.2310.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

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

  1. MDN: CanvasRenderingContext2D.imageSmoothingQuality
  2. MDN: CanvasRenderingContext2D.imageSmoothingEnabled
  3. HTML Standard: image smoothing in the 2D canvas
  4. 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.

More guides

Photos & filesPNG, JPG or WebP for screenshots? We saved the same one nine waysOne 1200 ร— 800 screenshot, nine encodings, measured for size and accuracy. Why JPEG is the wrong choice for text, and which WebP to use.Read guide โ†’Photos & files128, 192 or 320 kbps? What MP3 bitrate changes, measuredWe encoded the same audio at four bitrates with our converter. Size grows in a straight line; the main audible loss at 128 kbps is everything above 16.7 kHz.Read guide โ†’Photos & filesJPEG quality 60, 75 or 90? What we measured on six photosWe encoded six standard test photos at six quality levels and measured file size and SSIM. Here is where the savings stop being worth it.Read guide โ†’