Skip to content
Devtoolry
Web Development

How to Upscale an Image Without Losing Quality

Why enlarging a picture blurs it, how AI upscaling adds detail instead, a real 4× test against normal resizing, and when upscaling helps and when it can't.

Photo of Avinash KoriBy Avinash KoriPublished 5 min read

A small blurry photo enlarged two ways: stretched by normal resizing, still soft, and enlarged 4× by an AI upscaler, with sharp edges

Every picture has a fixed number of pixels. Make it bigger in an ordinary editor and the program has to invent the pixels in between, and the result looks soft, like a photo seen through frosted glass. That's fine for a thumbnail, and frustrating for an old photo you want to print, a logo that only exists as a tiny PNG, or a product shot that a marketplace rejects for being too small.

AI upscalers do better. This guide explains why normal resizing blurs, what an AI upscaler does differently, and shows a real side-by-side test, including the case where the numbers say the AI lost and your eyes say it won.

Why enlarging an image makes it blurry

When you resize a 320-pixel-wide image to 1280 pixels, three out of every four pixels in each direction didn't exist before. Ordinary resizing fills them in by interpolation: each new pixel is a weighted average of its neighbours. Bicubic interpolation, the default in most editors and browsers, looks at a 4 × 4 neighbourhood and draws smooth curves between the known values.

Averaging can only produce values between those it started from. A sharp edge, where dark meets light within a pixel, becomes a gradual ramp over four pixels. Fine textures turn to mush, and JPEG compression blocks are enlarged along with everything else. The picture is bigger, but it holds no more information than before, and the eye reads that as blur.

What an AI upscaler does differently

An AI upscaler is a neural network trained on millions of pairs of images: a sharp original and a smaller, deliberately damaged copy (blurred, noisy, JPEG-compressed). The network learns what sharp edges, fabric, foliage, skin and text usually look like at high resolution, given what they look like at low resolution.

When it enlarges your image, it doesn't average neighbours. It predicts the most plausible detail for each region: a crisp edge where an edge was, cleaned-up flat areas where JPEG blocks were. Our AI Image Upscaler uses Real-ESRGAN, an open-source model (BSD licence) designed for real-world photos rather than clean lab images. The model is 4.9 MB and runs in your browser, on the graphics card where the browser allows it and on the processor otherwise; the image is never uploaded.

The word to keep in mind is plausible. The model doesn't recover lost information; it guesses it convincingly. That distinction matters later.

A real test: 4× from a 320-pixel photo

To compare fairly, we took a NASA photo of the Mars rover (1280 × 941 pixels), shrank it to 320 × 235 pixels and saved it as a JPEG, then enlarged it back to 1280 × 940 two ways: bicubic resizing, and the AI upscaler at 4×. Because we kept the original, we can see how close each gets.

The same crop of the Mars rover photo three times: left, enlarged 4× with bicubic resizing, soft and blotchy; middle, enlarged 4× by the AI upscaler, with clean edges on the rover and rocks; right, the original full-resolution photo

The bicubic version (left) is soft everywhere, and the JPEG blocks of the small copy show as smudges. The AI version (middle) has clean edges on the rover's mast and wheels, distinct rocks and a smooth sky, much closer to the original (right) at a glance. Look at the ground, though: the fine gravel of the original is gone, replaced by a smoother surface. That's the model choosing a clean, plausible texture over noise it can't reconstruct.

Now the surprising part. A common way to measure how close an image is to its original is PSNR (peak signal-to-noise ratio; higher is closer). The bicubic result scored 27.3 dB and the AI result 26.7 dB. By the numbers, plain resizing won.

It didn't, and the reason is instructive. PSNR rewards being close on average, pixel by pixel. A blurry image that's a little wrong everywhere scores well; a sharp image that puts an edge one pixel off, or invents a slightly different texture, is penalised. Models like Real-ESRGAN are trained to look right to people, not to minimise average error, so they routinely score a little lower on PSNR while looking clearly better. If you ever compare upscalers by a single number, keep that in mind.

On this four-core laptop with no graphics card in use, the upscale took 9 seconds. In browsers that support WebGPU, the upscaler runs on the graphics card instead.

Logos and transparent images

Logos are where AI upscaling shines, because they're made of clean edges and flat colour, exactly what the model is good at. We enlarged a 128-pixel logo with a transparent background to 512 pixels:

A blue rounded-square logo with a white and yellow circle, enlarged 4× twice: left with bicubic resizing, with soft blurry edges; right with the AI upscaler, with crisp corners and circle edges

The bicubic copy (left) has soft, fuzzy edges. The AI copy (right) has crisp corners and circles. Transparency needs special care: the model only sees colour, so the upscaler runs a second pass on the transparency itself, treating it as a grey image. Without that pass the colours were sharp but the outline stayed fuzzy. Both passes together took 5 seconds.

How to upscale an image

  1. Open the AI Image Upscaler and choose your image (JPG, PNG, WebP, or an iPhone HEIC photo). You can add several; they're done one after another.
  2. Pick 2× or 4×. The new size is shown next to the file name.
  3. Press Upscale. The model downloads once (4.9 MB), then the image is enlarged piece by piece with a time-left estimate.
  4. Drag the slider and zoom in to compare with the original, then download as PNG, JPEG or WebP.

Some tips that make a visible difference:

  • Crop first. If you only need a face or a product, crop the image before upscaling. The model then spends all its effort on what matters, and the job is faster.
  • Choose the smallest factor that's enough. 2× is plenty for most screens and documents. 4× is for small sources or large prints.
  • Upscale once. Running a 4× result through again doesn't add real detail; it amplifies the model's own guesses into an over-processed look.
  • Start from the best copy you have. Heavily compressed images give the model less to work with. Upscale first, then compress the result if it needs to be small.

When upscaling can't help

Some things no upscaler can do, however good:

  • Recover details that aren't there. A blurry face stays unrecognisable; an unreadable number plate or line of text stays unreadable. If the model "sharpens" it, the result is invented, so never treat upscaled images as evidence.
  • Fix motion blur or bad focus. Upscalers enlarge; they don't undo camera shake. Dedicated deblurring is a different problem.
  • Keep film grain and fine noise. The model is trained to remove noise, so grainy photos come out cleaner than the original. Some people love that; for a vintage look, it's a loss.

For everything else (small web images, old photos, logos, screenshots and product shots that are just too small), an AI upscaler gives a far better result than stretching the pixels.

Photo of Avinash Kori

Written by

Avinash Kori

Founder of Devtoolry

Avinash is a full-stack web developer from Surat, India, with eight years of experience in PHP, Laravel and Angular. He built Devtoolry so developers can solve everyday problems quickly with free tools that run entirely in the browser, and writes practical guides on the formats, encodings and techniques behind them.

Connect on LinkedIn

Try it yourself

The free tools used in this article. They run in your browser, so nothing you paste is uploaded.