DEV Community

NullPointerZen
NullPointerZen

Posted on

Sharp but wrong: testing an AI upscaler against an original it never saw

Most AI upscaler comparisons you see online are useless, and it took me a while to work out why. They show you "before" and "after" — a blurry thumbnail next to a crisp result. Of course the crisp one wins. What's missing is the only thing that can settle the argument: what the picture actually looked like before anyone shrank it.

So I ran it the other way around. I made four sharp images first and kept them as ground truth, then downscaled each to a quarter of its size with plain interpolation. The small versions went into the upscaler, 4x, which lands exactly back on the original dimensions. Now every output pixel has a correct answer to be compared against. Two terms, in case you don't live in this world: interpolation is the old way of enlarging, where new pixels are averaged from their neighbours, so nothing is added and the result is soft. AI upscaling has a model guess what the detail should have been and paint it in, so the result is crisp. PSNR is just the pixel-by-pixel distance between two images, in dB, higher meaning closer to the truth.

The samples were a fictional product shot I drew with a script (invented brand, invented batch code), a fictional order form screenshot, a line-art icon, and a CC0 airport photo from Wikimedia Commons — that last one isn't mine. I ran everything through the AI upscaler on ImgIng (https://imging.ai/ ), all five model tiers at 2x and 4x, forty runs without a single failure. The practical reason I picked it: the work happens inside the browser, and with the Network panel open I could confirm the images never left the machine, so hammering it forty times cost nothing and leaked nothing.

The sharpest output was the wrong one

The batch code on the product packaging reads A7K-2291 in the truth image. At 20px in the original it survives as five pixel rows in the thumbnail. Lanczos interpolation gives you a smeared but perfectly legible A7K-2291. All five AI tiers agreed on A7K(2201 — the tail of the 9 flattened into a 0, the hyphen drawn as an opening bracket. On the order form, a total of 6,491.40 came back looking like 0,101.40 in two of the tiers.

Four panels of the same batch code: truth, thumbnail stretched, Lanczos reading A7K-2291, AI reading A7K(2201. The characters in frame are Chinese because I generated the sample myself

Scores tell the same story once you pick the right one. On the two samples containing small text, the best AI tier scored below plain interpolation: 26.48 dB against 27.85 on the product shot, 22.88 against 23.62 on the document. Meanwhile SSIM, which rewards local contrast and structure rather than pixel accuracy, ranked AI first on all four samples. It doesn't check whether that stroke is the stroke that was there. I looked at SSIM first and nearly wrote the opposite conclusion.

The dividing line is pixel height, not "is it text"

The airport photo makes this obvious in one frame. Large lettering on the fuselage came back sharper than interpolation and genuinely closer to the truth — real recovery. A smaller URL on the same aircraft was wiped out into a smudge. Distant road signs with three groups of numbers were redrawn as diagonal hatching and checkerboard, with every lowercase a turned into an o. Same image, same model, same run.

In numbers: a 28px line of text, seven pixels tall in the thumbnail, kept 9 of 9 characters readable through interpolation and 3 of 9 through the best AI tier. The same sentence at 20px, five pixels tall, scored 0 of 9 on both — but interpolation hands you an even grey smear, while the AI hands you neat, sharp, evenly spaced shapes that look exactly like characters. One of those tells you that you failed to read it.

The cleanest evidence needs no eyeballs at all. The body of the order form is pure greyscale. Counting pixels where the RGB channels diverge noticeably: the truth is 0.000%, interpolation is 0.000%, and the five AI tiers produced between 0.305% and 2.595%, with one tier hitting a channel gap of 98 at a single point. Colour cannot be recovered from an image that never contained any.

Where it genuinely wins

None of this makes AI upscaling a bad deal. It won two of my four samples, and on the line-art icon it won hard: 27.58 dB against 22.87, and the thin strokes that interpolation smears into grey bands come back as clean solid lines. The photo went to AI too, by a narrow 0.47 dB. The rule I ended up with is about content, not model tiers. Icons, line art, flat colour, large lettering — upscale away. Serial numbers, amounts, spec digits, small text — check against the original regardless of how confident the output looks. Around eight pixels of height is the tipping point, where digits tend to survive and characters start turning into other characters.

The ImgIng docs say upscaling infers detail and shouldn't be used for identity documents, forensics, historical research or verifying OCR source text. My run backs that up for the small-text half of it. For the rest I have nothing: no faces, no ID documents, no old photographs in my samples, so I'm quoting that part rather than confirming it. I also don't know yet whether the five-pixel threshold moves with a different typeface or a different script — I varied the size, not the font.

Top comments (0)