Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Before You Upscale Anything, Find Out Which of the Three Softnesses You Have

Every "my photo is blurry, should I upscale it" question hides three different problems, and an upscaler only fixes one of them. If you guess wrong, you pay for a 4× pass that makes the file eight times larger and the image no better — or worse, you pay for it and the result looks sharper at 100% while carrying artefacts that were never in the original. This post is a diagnostic procedure, not a…

When you encounter the question, "my photo is blurry, should I upscale it?" there are actually three different issues at play, and an upscaler can only address one of them. Choosing the wrong approach could result in paying for a larger file size that does not improve the image or, in some cases, makes it worse. This article provides a diagnostic procedure to help determine which problem you are facing, based on measurements taken on seven photographs and a 96-frame clip.

The comparison involved a JPEG-compressed source versus an uncompressed master, and four resampling kernels across six up/down round-trips.

There are three types of softness that can affect an image. The first is uniformly soft everywhere, with no crisp edges, even in high-contrast regions. This is caused by optical issues like lens, focus, or motion blur, or by scanning below the print's true detail. An upscaler cannot fix this problem. The second issue is when an image is sharp in some areas but blocky or ringing near edges, with fine texture appearing "dirty" rather than detailed.

This is caused by compression, particularly with an 8×8 DCT grid that removes high frequencies and leaves quantisation noise behind. Upscaling only magnifies these block boundaries instead of fixing them. The third issue is when an image appears sharp but slightly off, with fine details missing and colour fringing on boundaries.

This is caused by resampling, typically when an image has already been resized multiple times using a kernel that discards detail. An upscaler will not be able to recover the lost detail, so you should go back to the original source instead.

The three types of softness respond to opposite treatments. Compression damage requires a low-pass step to remove the block edges, while optical softness needs a high-pass step to sharpen the image. Resampling damage, on the other hand, needs no intervention at all – you need to find a better source and stop touching it. Applying the wrong treatment will only make the problem worse by adding quality instead of buying it.

To illustrate the impact of JPEG compression, the author took a single 1080×1620 photograph and encoded it at five different quality levels (30, 50, 70, 85, 95). The JPEG quality levels were then upscaled by 2× using Lanczos and compared against an upscale of the uncompressed original. Two measurements were taken: the detail ratio (R), which represents the high-frequency energy in a narrow band compared to a band away from any boundary, and the mean grey-level step across that boundary.

As the quality decreases, the detail ratio R increases, indicating a larger block edge present in the upscaled JPEG. Even at the highest quality level (q95), R remains at 1.41, showing that the block edge is a fundamental characteristic of JPEG encoding and cannot be eliminated through upscaling.

The trend shows that as the JPEG quality improves, the detail ratio R and high-frequency energy both decrease, suggesting that the high-frequency content in low-quality encodes is largely noise. Therefore, upscaling a low-quality JPEG file will amplify noise and make the block grid more visible. Consequently, using an upscaler with a JPEG source at a lower quality can worsen the overall image quality.

To determine if compression or resampling damage is present, you should compare the upscale against two references: the JPEG-decoded source and a PNG of the same content that never interacted with the codec. The difference between the two references represents the codec's contribution, while the rest is resampling. The PSNR gap between these two references indicates the codec's contribution, while the mean squared error (MSE) quantifies the resampling error.

In summary, understanding the three types of softness and their distinct treatments is crucial when deciding whether to upscale an image. Compression damage needs a low-pass step, optical softness requires a high-pass step, and resampling damage can only be addressed by acquiring a higher-quality source. By applying the appropriate treatment, you can improve the image quality without incurring unnecessary costs or worsening the result.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

More from Thursday 26 November →