The one case where blur is reversible
Suppose the shutter was open for a fortieth of a second and the camera travelled a few millimetres in a straight line during it. Every point of light in the scene landed not on one sensor cell but on a short row of them, each receiving a share of the exposure. The resulting file is the sharp picture convolved with a line segment: a kernel with a length, in pixels, and a direction, in degrees. Nothing was thrown away — it was spread out. Given the segment, the spreading can be undone to a useful degree, which is what the solver on this page does.
Now suppose instead that the lens was focused two metres behind the subject. Every point landed on a disc, and the values inside that disc were averaged with their neighbours until the fine detail that distinguished them ceased to exist as a difference. Averaging is not invertible in any meaningful sense once noise is present, and the higher the spatial frequency, the more completely it has been annihilated. You can sharpen such a frame — the edges that remain can be made steeper — but nothing will return the texture, and any tool that appears to is generating plausible detail rather than recovering real detail.
Everything the model gets wrong about a real photograph
- Real camera shake is a curve, not a segment. A hand rotates as well as translates, and the path over a fortieth of a second is usually a small squiggle. One length and one angle fit a squiggle badly, and the fit gets worse the longer the exposure.
- Subject motion is local. This operator is global, so a kernel that suits the moving subject will ring over the still background.
- Depth varies across the frame. A camera that rotates blurs distant objects less than near ones, so no single length is right everywhere.
- A rolling shutter skews as well as smears, and skew is not a convolution at all.
- Compression is read as signal. A JPEG that has already been saved hard carries eight-pixel block edges, and the solver treats that grid as structure worth amplifying. The same picture straight from the camera deconvolves visibly better.
- Defocus is a disc, not a line, and the disc case is not offered here at all — not because it is difficult to implement, but because a control that implies recovery where there is none is worse than no control.
None of that makes the pass useless. It makes it a tool with a stated domain: a frame shaken mildly, evenly, in roughly one direction, with a clean file underneath. Inside that domain it does real work, and the 1:1 view is there so you can confirm it did.
Reading a deconvolved result without fooling yourself
A deconvolved crop looks impressive on its own and considerably less so beside the frame it came from, which is why the comparison is a held gesture rather than a separate screen. Three things to check at 100%, in order. Whether the edges have become edges or have become edges with stripes beside them. Whether the flat areas — sky, wall, skin — have acquired a fine periodic texture that was not there, which is the noise term set too low. And whether anything in the frame has gained detail that could not have been recorded: lettering that is now legible, or a pattern in fabric that has appeared from nothing. The third is the one to be most suspicious of.
Questions that arrive with a shaken photograph
- Every other page promises to unblur any photograph. Why does this one start by saying it cannot?
- Because the two situations people call blur are not the same situation. Straight, even camera movement transforms the information in the frame — every point is drawn into a line of a particular length in a particular direction — and a transform has an inverse that can be partly computed. A lens that was focused on the wrong plane spreads every point into a disc and the fine detail is averaged away entirely. One is a rearrangement, the other is a loss. A page that offers the same slider for both is selling the second on the strength of the first.
- How does the page work out the angle and the length without being told?
- Two estimators that fail in different ways. The angle comes from directional derivatives: motion destroys detail along the direction of travel and leaves it across that direction, so the squared difference between a pixel and its neighbour a few pixels away is smallest along the path. That is robust but biased by any picture with strong structure in one direction. The length comes from the cepstrum — the inverse transform of the log spectrum — where the periodic nulls that a line kernel puts into the spectrum collapse into a single trough at exactly the blur length. That is sharp but easily fooled, so it is searched only within twenty-five degrees of the angle the first estimator proposed.
- The estimate looks wrong. Can I set it myself?
- Yes, and on a real photograph you often should. Find a small bright point that has been smeared into a dash — a street light, a reflection on chrome, a catchlight in an eye — and set the length to the length of that dash in pixels and the angle to its direction. That measurement is more trustworthy than either estimator, because it is the point spread function itself, drawn on the picture by the camera.
- Why does the result have faint stripes next to the high-contrast edges?
- That is ringing, and it is the deconvolution's characteristic failure. The inverse of a line kernel has enormous gain at the frequencies where the kernel itself is near zero, so anything sitting at those frequencies — noise, JPEG block edges, a slightly wrong length — comes back amplified as a periodic pattern. The noise term in step three is the floor under that division. Raising it suppresses the ringing and gives back some of the recovered detail; there is no setting that gives both.
- Can it fix a photo where only the moving subject is blurred?
- No. This is a global operator: one angle, one length, applied to every pixel in the frame. A cyclist crossing a still street was smeared while the background was not, so any kernel that suits the cyclist is wrong everywhere else and will ring across the whole background to fix one thing. Local, subject-aware deblurring is a different problem and is not attempted here.