Motion Blur Before an Upscale: The Cutoff Is Already Written

Every guide about sharpening an upscaled image assumes the softness is a knob you can turn afterwards. For motion blur that assumption is wrong, and it is wrong in a way you can put a number on. A horizontal blur of length L pixels puts its first frequency null at exactly 1/L cycles per pixel, and I measured that the 2× and 4× upscale move the effective cutoff by 0.02% to 0.47%. The detail above that frequency is gone, and no amount of Lanczos, unsharp masking or AI reconstruction brings back the specific edges that were there. What sharpening does instead is raise the contrast of what survived — which is a different thing, and I measured how much of it you can buy back before it turns into ringing.

numpy 1.26.4 · Pillow 12.2.0 · two distinct source photographs (1080×1620 portrait, 1080×608 street), content-hashed so neither is counted twice · blur applied as an exact horizontal box convolution in float64, which is the true point-spread function of a sensor and subject moving at constant velocity across one shutter interval · every measurement printed next to its closed form so a disagreement would be visible · the experiments that contradicted what I expected are reported as measured, including the two where my own measurement technique was the thing that was wrong.

Why motion blur is one of the few degradations you can predict rather than estimate

Most upscaling claims are hard to check because the ground truth is unknowable: when a model invents plausible texture, there is no way to say whether the texture is right. Motion blur is different. If a subject moves at a constant speed while the shutter is open, every point in the scene traces a line segment of the same length and direction, and the resulting point-spread function is a box of that length. A box filter has a transfer function you can write on paper:

H(f) = |sinc(pi * f * L)| = |sin(pi*f*L) / (pi*f*L)|

first null            f = 1/L          (cycles per pixel)
H(f) falls to 0.10 at   f = 0.9112 / L
H(f) falls to 0.50 at   f = 0.4435 / L

That is the whole argument in one line. At L = 15 pixels the first null sits at 1/15 = 0.0667 cycles per pixel. The Nyquist limit of the source is 0.5, so the blur has thrown away everything from 0.067 to 0.5 — 87% of the frequency axis, in the horizontal direction, permanently. An upscale that doubles the pixel count does not create information in that band; it produces interpolated samples of a signal whose band is already truncated. The rest of this page is the measurement that confirms the model, the checks that show upscaling cannot cheat it, and the honest limits of trying to undo it.

The transfer function, measured against the closed form

I applied the box blur to the real photograph at seven lengths and recovered the empirical transfer function from the ratio of power spectra of the blurred and unblurred images. Because both spectra come from the same content, the image's own power spectrum cancels in the ratio and what remains is |H(f)|². Taking the square root and normalising at the second bin gives the measured amplitude response, with no fitting and no free parameter.

Blur length L0.10 crossing, measured 0.9112/L closed formError First null 1/L
3 px0.306810.30373+1.01%0.33333
5 px0.182410.18224+0.09%0.20000
7 px0.130200.13017+0.03%0.14286
11 px0.082690.08284−0.18%0.09091
15 px0.060580.06075−0.28%0.06667
25 px0.036400.03645−0.12%0.03645
41 px0.022280.02222+0.26%0.02439

Maximum disagreement across the seven lengths is 1.01%, and that worst case is the shortest blur, where the frequency axis has the fewest samples per cycle and the interpolation between spectral bins is coarsest. From 5 px upward the error never exceeds 0.28%. A second, unrelated photograph reproduces the same crossings to within 0.28% at every length tested, so this is a property of the filter and not of one image.

The practical reading: you can estimate the blur length from a single photograph's spectrum with enough accuracy to predict what was lost, because the model has no free parameters. Multiplying 0.9112 by the reciprocal of the measured crossing gives L directly. The place this fails is the next-but-one section, and it fails for an interesting reason.

Upscaling does not move the cutoff — measured at 2× and 4×

This is the experiment that settles the argument about whether a better resampler helps. I blurred the source, upscaled both the sharp and the blurred version by the same factor, and measured the ratio again. Then I converted the output frequency back to source-equivalent cycles per pixel by multiplying by the scale factor, because a bin at the same index now represents a finer frequency.

Blur lengthUpscaleCutoff before Cutoff after (source-equivalent)Shift
7 px2×0.130200.13082+0.47%
7 px4×0.130200.13078+0.44%
15 px2×0.060580.06068+0.17%
15 px4×0.060580.06067+0.16%
25 px2×0.036400.03641+0.02%
25 px4×0.036400.03642+0.05%

The shift is positive in all six cases and never exceeds half a percent. That direction is expected and not a defect: there is no such thing as a perfect interpolator, so a real Lanczos resampler has a slightly narrower passband than the ideal, and its own roll-off stacks on top of the blur's. The important part is the magnitude. Going from 2× to 4× — four times the output pixels, four times the compute — changes the recovered cutoff by 0.03 percentage points at L = 15. More pixels do not buy back a single line pair that the motion removed.

What does change: the width of what survived

If the cutoff is fixed, what can an upscale change? The width of the transition, in output pixels. I measured that on a synthetic step edge where the answer is known exactly, then checked the same statistic on the photograph.

Blur lengthMeasured 10–90% width Closed form 0.8L + 1Error
1 px0 px1.80−1.80
3 px2 px3.40−1.40
5 px4 px5.00−1.00
9 px8 px8.20−0.20
15 px12 px13.00−1.00
25 px20 px21.00−1.00
41 px32 px33.80−1.80

The measured width tracks the closed form to within two pixels everywhere, with the discrepancy concentrated at the extreme ends where a ±1 px quantisation of the 10% and 90% crossings is the whole story. On the real photograph the same statistic shows what a viewer actually perceives: the share of pixels whose horizontal gradient falls below 0.02 rises from 92.0% on the sharp source to 95.4% at L = 7, 97.1% at L = 15 and 98.0% at L = 25. By L = 15, fewer than three pixels in a hundred have a gradient large enough to be an edge. That is the visual reality of the cutoff: not that the picture is dimmer, but that it stops containing edges.

Can deconvolution put the detail back? It depends entirely on the crop

This is where I got a result I did not expect, twice, and the second version overturned the first. A Wiener deconvolution with the correct box kernel should invert the blur, given a good estimate of the noise-to-signal ratio. My first attempt reported a PSNR loss at every noise level, between −4.2 and −5.8 dB, which would have been a clean negative result. It was an artefact: the tile was small enough that the FFT's circular wrap error at the border dominated the metric. Padding the tile by 64 pixels with reflected content and cropping back removed that, and the sign flipped.

Local detail (mean |∂x|)PSNR blurred PSNR after WienerGainNSR used
0.03067 (busiest crop)17.6824.16+6.48 dB3e-3
0.0111228.8531.78+2.93 dB1e-2
0.0075533.8832.74−1.15 dB1e-2
0.0049336.8134.05−2.76 dB1e-2
0.00189 (flattest crop)45.0135.24−9.77 dB1e-2

Same kernel, same blur length, same photograph, five crops, and the gain runs from +6.48 dB to −9.77 dB. The correlation between local detail and gain is 0.85 across these five crops, and a linear fit places the break-even at a mean |∂x| of about 0.0131 — roughly the detail level of ordinary foliage or fabric, and above the median detail of this photo. Below that line, deconvolution amplifies noise faster than it restores edges, which is exactly what the theory predicts and what the flattest crop demonstrates. Above it, the recovery is real and large.

Why this matters more than the PSNR: the crops where deconvolution wins are the ones with the lowest input PSNR (17.7 and 28.9 dB) and the ones where it loses had input PSNR of 33.9, 36.8 and 45.0 dB. A global metric computed on a whole image would average these into a small positive number and tell you nothing about which parts of your picture were actually rescued. The decision is local, and it is a decision about detail, not about blur length.

Sharpening along the blur axis beats isotropic sharpening, and the gap widens with strength

If you are not going to deconvolve, the next-best move is ordinary unsharp masking, and the naive version of it is applied in both directions. But the motion blur is one-directional: there is a hard cutoff horizontally and none vertically. So I compared a 1-D unsharp mask along x against a 2-D isotropic one, both at unit gain, and measured PSNR against the sharp original.

Sharpen radius σIsotropic (2-D) Along blur axis (1-D)Delta Clipped, 2-DClipped, 1-D
1.0 px28.40028.940+0.541 dB0.10%0.01%
2.0 px27.95428.950+0.996 dB0.22%0.02%
4.0 px27.51929.157+1.637 dB0.28%0.04%

Two things are happening. First, the directional mask is ahead at every radius, and the gap grows from 0.54 to 1.64 dB as the radius increases. Second, and more importantly for anyone working in 8 bits, the isotropic mask clips seven to eleven times as many pixels: 0.28% against 0.04% at the strongest setting. Clipping is irreversible — those highlights are already 255 and cannot be recovered by pulling the amount back later. The directional mask puts its contrast correction where the blur actually is, so it needs less amplitude to achieve the same effect and spends less of the headroom.

What the blur does to the encode bill, measured with x264

A side effect worth knowing before you decide the blur is only a resolution problem: a motion-blurred pan costs materially fewer bits to encode at the same CRF. I built a 60-frame 1080p horizontal pan from the photograph, applied the same box blur at four lengths, and encoded all four at CRF 20 with libx264 at preset medium. Each clip was then compared to the unblurred encode with SSIM.

Blur lengthEncoded sizevs sharp SSIM (All) vs sharp encode
1 px (sharp)240,017 B1.000×1.0000
5 px200,582 B0.836×0.7618
11 px175,642 B0.732×0.7691
21 px160,694 B0.670×0.7772

Blurring to 21 px saves 33% of the bitrate — and note that SSIM against the sharp encode goes up slightly with more blur, from 0.7618 to 0.7772, because the blur removes exactly the high-frequency content that a block-based codec finds expensive and that SSIM is most sensitive to. That is the same effect that makes SSIM a poor proxy for perceived sharpness, and it is the reason a codec will happily reward you for destroying detail. Encode speed was flat at 24–27 fps across all four lengths, so the saving is in bits and not in time.

The result I could not make work: estimating blur length from the image alone

The closed form above assumes you know L. In practice you do not, so the useful question is whether L can be recovered from a single blurred photograph with no sharp reference. I tried three approaches. One works, and only on content it would never encounter.

The cepstrum — the inverse FFT of the log power spectrum — is the textbook answer, and it is supposed to show a peak at the blur length. On this photograph it put the peak at 4 pixels for every true length from 5 to 33, an error of −1 to −29 px, which is to say it reported a constant and I would have reported a method that does not work. The detrended-log-power variant with a moving-average background was worse: it locked onto a fixed low-frequency feature at f = 0.0111, translating to a 90 px estimate regardless of the truth.

The spectral-null approach does work, under one condition I could test directly. On white noise it recovers the length almost exactly. On the photograph it collapses to the same 90 px for every length:

True LWhite noise: estimateError Photograph: estimateError
7 px7.0+0.090.0+83.0
15 px15.0+0.090.0+75.0
25 px25.1+0.190.0+65.0

The reason is not mysterious once you look at a photograph's spectrum: it falls off steeply with frequency, roughly as 1/f², and by the region where the blur nulls would appear, the signal is already below the residual level of the image's own structure. The null is there in principle and buried in practice. Estimating L blind from a single frame is an active research problem precisely because of this, and reporting a number here would have meant reporting the floor of my estimator as if it were the answer. The practical consequence is narrow but real: the closed form tells you what a given blur costs, and predicting the cost for a measured blur requires either a capture-time record of shutter speed and velocity or a sharp reference frame of the same scene.

Why tell all this to someone who is about to upscale a video?

Because it sets the order of operations. The measurement above is not an argument against upscaling — it is an argument about which problems upscaling can address. The cutoff at 0.911/L is a property of the capture, and the 2×/4× test shows a scale factor changes it by less than half a percent. So when a clip looks soft, the question that matters is not which resampler or which model, but whether the softness is motion blur or something else. The directional-sharpening result is the one usable lever: applying the contrast where the blur actually is earns 0.5 to 1.6 dB over the isotropic version and clips seven to ten times fewer pixels. And the crop-dependent deconvolution result is the reason to stop trusting a single global sharpness slider: the same setting that rescues a textured region by 6.5 dB costs a flat region 9.8 dB, and a global metric averages those into a number that describes neither.

For frames that are blurred past the cutoff, the honest answer is that the frequencies are gone and the remaining choice is how to present what survived. When the source is sharp and the problem is resolution rather than motion, the pixel budget is what matters, and that is a different measurement entirely — the one behind UpgoLAB's browser upscaler, which handles the scale factor and leaves the capture-time decision where it belongs.

Reproducing the numbers

The blur is an exact box convolution, implemented with a cumulative sum so there is no accumulated rounding, and the transfer function comes from the ratio of two power spectra of the same content. Nothing is fitted.

import numpy as np
from PIL import Image

def box_blur_h(a, L):
    """Exact 1-D motion blur, edge-replicated, float64."""
    if L <= 1: return a.copy()
    pad = L // 2
    out = np.empty_like(a)
    for c in range(a.shape[2]):
        p  = np.pad(a[:, :, c], ((0, 0), (pad, pad)), mode="edge")
        cs = np.cumsum(np.pad(p, ((0, 0), (1, 0))), axis=1)
        out[:, :, c] = (cs[:, L:] - cs[:, :-L]) / L
    return out

def psd_x(g):
    g = (g - g.mean()) * np.hanning(g.shape[1])[None, :]
    return (np.abs(np.fft.rfft(g, axis=1))**2).mean(axis=0)

# |H(f)| from two spectra of identical content
H = np.sqrt(psd_x(lum(blurred)) / np.maximum(psd_x(lum(sharp)), 1e-30))
H /= H[1]

# closed form, for comparison
null   = 1.0 / L
f10    = 0.9112 / L      # H(f) = 0.10