OpenPixels / Blog

Enlarged, not invented: how OpenPixels checks its own work

The worry with any AI upscaler is easy to state. The result looks sharper, but is the detail real, or did the model make it up? Most tools show you a picture and leave it there. OpenPixels measures every result and shows you what changed, on your own device, in the same page that did the work.

What you see after a run

Under the before/after slider is a short panel headed What changed. It leads with sentences, not statistics: how much sharper the result is, how the noise moved, the new size against the old one, and, when the result earns it, Faithful to the original. The raw figures sit under The numbers, for anyone who wants them.

The example on the home page is a real run. A 288 × 360 low-quality JPEG was enlarged 2× to 576 × 720. The app reported it 3.7× sharper, and faithful.

Shrink it back and compare

There is no sharper original to check an enlargement against. That photo was never taken. So OpenPixels checks the one thing it can: it shrinks the result back to the size you started with and compares it with your photo.

Two standard measures do the comparing. PSNR, in decibels, scores the overall difference. SSIM, where 1 means identical, scores whether the structure lines up: edges, textures, shapes. If the model had drawn a different eye or a different brick pattern, the shrunk-back result would stop matching your original, and both numbers would fall.

The rule behind the badge

Faithful to the original appears only when SSIM is at least 0.7 and PSNR is at least 20 dB. SSIM was once the only test, and replacing a background defeated it: the shapes survive while every pixel around them changes. On white-backed photos SSIM read 0.80 while PSNR was 13–14 dB. Ordinary enlargements measure 22–42 dB, so a floor at 20 separates enlarged from repainted with room on both sides.

Two kinds of run never get the badge. If you removed the background, made it white or colourised the photo, the result is meant not to match, so the claim is not made. And if the photo had to be reduced before the model saw it, the numbers describe that reduction rather than the photo you chose, so the app says nothing about “the original”.

Sharpness and noise

Sharpness is the variance of the Laplacian, a standard focus measure. The comparison is not with your small original. It is with the same photo enlarged to the same size by a plain resampler, on the same window of up to 1024 × 1024 pixels. So “3.7× sharper” means sharper than simply making it bigger. Below 1.15× the panel says About as sharp instead of quoting a ratio.

Noise uses Immerkær’s estimator, on the original and on the result, each at its own scale: what you see at 100%. A photo with almost none to begin with is reported as Already clean.

What it cannot tell you

A faithful result matches your photo at the size you gave it. Detail finer than your original pixels is the model’s best estimate, and no measurement can confirm it, because nothing recorded it. The badge rules out a model that changed what was there. It does not prove that what was added is true.

Where the numbers come from

The measurements run in your browser, in Rust compiled to WebAssembly, next to the models. Your photo is never uploaded, so the check happens where the photo already is. In a batch, the same figures for every photo download as one CSV. The code is open source under MIT or Apache-2.0, in crates/pixels-core/src/metrics.rs, with tests that hold PSNR and SSIM to their definitions.

Open OpenPixels and drop in a photo. More posts are on the blog.