Every marketplace that asks for 2000 × 2000 receives some number of files that were not shot at 2000. A 600 px export, a supplier's catalogue thumbnail, a listing screenshot, blown up until the pixel count is legal. File size does not tell you, and at the size a buyer actually views the thing it often does not matter visually.

The edge tells you. Not the width of the edge — that number is easy to move and this series has already shown it being moved: sharpening narrows a rise by 45 % while tripling the distance from the master. What is hard to move without leaving a trace is the halo: the thin band on the bright side of the edge that goes above the plateau and the one on the dark side that dips below it. Every separable resampling kernel leaves a specific amount of it, and the amount is not a matter of taste — it is the kernel's step response, and it can be written down in closed form.

So this post does the arithmetic first, then measures, and then checks that the two agree. Which is the only order that makes the halo usable as evidence.

The five things this measures, and the one it does not

An enlargement by N of a hard edge produces a profile with five readable features:

  • width, in pixels: 1 / Σ(Δp)² on the normalised profile. No threshold anywhere, so it does not flap. A hard step reads 1.00, a two-pixel ramp 2.00, a four-pixel ramp 4.00 — that is a self-check, not a calibration.
  • overshoot, as a fraction of the step height: how far past the plateau the bright side gets.
  • undershoot: the same on the dark side. For a symmetric kernel these are equal, which is itself a check.
  • rings: sign changes in the residual outside the transition, with a dead zone of two 8-bit levels so quantisation noise is not counted as ringing. A kernel with no negative lobes must read zero here.
  • MTF at a named frequency, from the edge profile by FFT of its derivative.

What it does not measure is whether the picture looks good. Nothing here does. This is about what can be proved about a file.

Why the halo can be predicted but the rise cannot

A separable resampler is a filter, and a filter has a frequency response. For a kernel K the response is H(f) = ∫ K(t) e^{-2πift} dt, and the step response is S(x) = Σ K(x − j) summed over the source samples on the bright side. Both are closed forms. Neither needs a test image, a neural network, or an opinion.

That gives an answer key. The Lanczos-3 enlargement of a step measures 11.7 % overshoot; the arithmetic for the Lanczos-3 kernel says 11.8 %. The meter and the kernel agree, so both can be used. If they disagree, one of them is wrong and the number is decoration.

A 10-to-90 % rise measurement has no such key. It returns a smaller number for a blurred edge, a smaller number for a sharpened one, and the same smaller number for both, which is precisely why "it looks sharper" survives every quality gate that measures width alone.

The instrument, and the four things it was checked against

Two fixtures, because one edge cannot do both jobs.

A slanted edge, tilted 5°, puts the edge at a different sub-pixel phase in every row. Binning rows by distance from the line gives a profile sampled finer than one pixel, which is what an MTF needs. It is also what ruins an overshoot reading: in a pixel grid the tilt is a staircase, the bins average rows whose edges sit up to half a pixel apart, and the peak of a 1.5-pixel-wide ringing lobe is smeared away.

Measured both ways on the same seven files:

kernel slanted overshoot axis-aligned overshoot ratio
bicubic −0.5 4.3 % 7.4 % 0.58
bicubic −0.75 6.1 % 11.2 % 0.54
lanczos2 4.7 % 8.0 % 0.59
lanczos3 7.0 % 11.7 % 0.60
lanczos5 7.6 % 13.3 % 0.57

Same file, same kernel, only the way the profile is taken — and the halo comes out at 54–60 % of its real height. That ratio holds to a tenth of a point across bin widths, so it is the binning doing it and not a badly chosen parameter. What is not stable is the width column on the same binned profile: it reads 6.8 px on Lanczos-5 with a coarse bin grid and 10.1 px with a fine one, and 10.7 against 20.1 on bilinear. A quantity that moves by 90 % when you ask for more bins is not a measurement, which is why no width in this post comes from a binned profile.

So: MTF from the slanted edge, overshoot from the axis-aligned one, and the axis-aligned edge placed on a plateau at 0.86 rather than 0.92, because a 13 % overshoot on a step that ends at 0.92 hits 1.0 and the clip eats the peak. On a real photo that clip is the story — it is the white fringe people actually complain about — but it is not the kernel's response, and mixing the two produces a number that is neither.

Four checks, all against arithmetic rather than against another encoder:

check what it should be what it read
sine gratings of period 8, 16, 32 px, contrast 0.700 0.700 0.693 / 0.699 / 0.702
ramps of 1, 2, 4, 8 px through 1/Σ(Δp)² 1.00 / 2.00 / 4.00 / 8.00 1.00 / 2.00 / 4.00 / 8.00
kernel gain at 0.0625–0.4 cycles/source-px, vs ` H(f) `
edge MTF of a Gaussian blur, vs exp(−2π²σ²f²) σ = 1.0 → 0.821 at 0.10 0.815
σ = 2.0 → 0.454 at 0.10 0.453
σ = 3.0 → 0.169 at 0.10 0.175

The third row is the one that matters for everything below: a sine at one frequency puts all its energy in one place, so the amplitude that comes out of the kernel is the gain, with no window and no ambiguity. Four periods, five kernels, twenty measurements, worst disagreement with the closed form 2 %.

One trap in that check worth passing on. A grating of period exactly 2 px sampled at integer pixels is sin(πj) = 0 everywhere — the input is a flat line and the measured gain is noise. Integer periods cannot reach Nyquist. Use 2.5.

Seven kernels, one edge

A 256 px hard edge enlarged 4× through seven filters. Width, MTF50, MTF at 0.25 cycles per source pixel (= 0.0625 per output pixel), overshoot, the closed-form overshoot, ring count, and the RMSE against the 1024 px master the small file was derived from — because the master is the only object in the room that knows what the picture looked like before somebody shrank it.

kernel width px MTF50 MTF@0.25 overshoot closed form rings RMSE edge RMSE
nearest 1.00 0.151 0.902 0.0 % 0.0 % 0 5.197 47.83
bilinear 4.57 0.108 0.802 0.0 % 0.0 % 0 4.432 40.82
bicubic −0.5 3.67 0.124 0.930 7.4 % 7.4 % 1 4.212 38.68
bicubic −0.75 3.54 0.123 0.967 11.2 % 11.1 % 1 4.174 38.25
lanczos2 3.66 0.124 0.933 8.0 % 8.5 % 1 4.206 38.62
lanczos3 3.41 0.124 0.991 11.7 % 11.8 % 3 4.127 37.76
lanczos5 3.24 0.124 0.977 13.3 % 13.2 % 7 4.091 37.36

Seven kernels, one fixture, and the two columns that matter — measured and closed form — agree to within 0.6 percentage points, with the largest miss on Lanczos-2, the one whose weight sum ripples most across a phase period and therefore needs the normalisation the closed form has to include too.

The ring counts run 0, 0, 1, 1, 1, 3, 7 in order of support. Not a coincidence: support is what decides how many times the kernel can change sign, and the count is a direct read of that. Bilinear and nearest are exactly zero, which is a property of a kernel with no negative lobes, and it is the property a QA gate can use as a floor.

The same edge through five kernels, with measured overshoot against the closed-form step response

And the RMSE column says the thing that makes this awkward: the kernel with the largest halo is also the closest to the master. Lanczos-5's 13.3 % overshoot is not a defect in the round trip — it is a slightly-too-eager reconstruction that is, on the whole frame and on the edge, less wrong than the careful ones. A halo is the price of a sharper reconstruction, not proof that the reconstruction is bad. What makes it evidence is that each price is specific.

Two of them cannot be told apart by the halo

Nearest and bilinear both read 0.0 % overshoot and 0 rings. On the halo alone they are identical, and they are not the same resampler: nearest is 4 px of staircase and bilinear is a 4 px ramp.

The width column separates them — 1.00 against 4.57 — but it separates them in a way that should make you distrust the column. A 4× enlargement cannot produce an edge a quarter as wide as the thing it enlarged, and nearest appears to, because 1/Σ(Δp)² measures the energy of the steps and a staircase spends all of it in one sample. The number is not lying about the steps. It is lying about the picture.

MTF at 0.25 cycles per source pixel separates them honestly: 0.902 for nearest, 0.802 for bilinear, 0.900 and 0.811 predicted. That is the usable pair of readings — the halo says "not one of the ringing kernels", the MTF says which of the two non-ringing ones.

MTF50 is not resolution

Look at the MTF50 column: every kernel except nearest and bilinear sits at 0.123–0.124, and nearest sits at 0.151, above the original's own Nyquist of 0.125 cycles per output pixel.

Nearest is a 4-px zero-order hold. Its response is sinc(4f), which crosses one half at 0.151 and reaches zero at 0.250. Nothing was resolved there — the source had no content above 0.125 to resolve — and the curve still crosses 0.5 above the limit. So a high MTF50 is not evidence of anything except a filter that happens to cross half at that frequency.

What distinguishes a reconstruction from an invention is the shape, not the crossing. Every kernel here carries about one unit of modulation and then collapses toward zero at the original's Nyquist: measured peaks away from DC run 0.991 to 1.006, and their closed forms permit a worst-case ripple of 1.5 % (bicubic −0.75 at 1.0153). A sharpened image does not ripple above 1 by a percent; it multiplies. The next section reaches 1.640.

Sharpening is not a kernel

Unsharp mask is out = in + amount × (in − gaussian(in, radius)). It is not a resampling kernel, it has no fixed frequency response, and it does not behave like one. The same 4× edge, nine settings:

amount radius width px MTF@0.25 MTF50 overshoot rings
— — 3.43 0.999 0.125 12.2 % 3
0.5 1 3.08 1.039 0.129 13.9 % 3
0.5 2 2.50 1.134 0.135 19.1 % 3
0.5 3 2.15 1.240 0.136 23.5 % 3
1.0 1 2.79 1.070 0.133 16.5 % 5
1.0 2 1.91 1.255 0.141 25.2 % 5
1.0 3 1.44 1.471 0.143 34.8 % 3
1.5 1 2.52 1.111 0.136 18.3 % 5
1.5 2 1.46 1.382 0.146 32.2 % 5
1.5 3 1.11 1.640 0.145 46.1 % 3

Four things in that table.

The amount sets the height of the halo, the radius sets the width, and the width of the edge follows both. From 3.43 px down to 1.11 px — the 4× enlargement is 68 % undone. Overshoot from 12.2 % to 46.1 % of the step height, and this fixture's step is 115 luminance levels (0.15 to 0.60), so that is 14 levels of white above the plateau becoming 53.

MTF@0.25 goes above 1. The unsharpened 4× enlargement reads 0.9985 at that frequency; radius 3 amount 1.5 reads 1.6397, which is 64 % more modulation there than in the file it was made from. Every kernel in the table above stayed inside 1.5 % of unity. That is not a reconstruction behaving slightly eagerly; that is contrast added.

MTF50 barely moves. 0.125 to 0.146 across the whole sweep. The number everyone quotes as "sharpness" gains 17 % while the edge width drops 68 %. If you are choosing a sharpening setting by MTF50, you are choosing it blind.

Ring count is not monotone. It runs 3, 3, 3, 3, 5, 5, 3, 5, 5, 3 down the table with no pattern I can defend. At radius 3 the halo is wide enough that its shoulder merges with the kernel's own first ring, and the sign changes stop being countable. This is where the metric runs out rather than where the picture gets better, and I would not quote those numbers.

The fixture here is a step with its bright plateau at 0.60 rather than 0.86, because a 46 % overshoot on a plateau at 0.86 has nowhere to go. Its unsharpened baseline reads 3.43 px where the other fixture reads 3.41 — that 0.6 % is the size of the difference the fixture itself makes, and it is the floor on any comparison between the two tables.

The dark side has the mirror problem. This fixture's low plateau sits at 0.15, so an undershoot of 33 % of a 0.45 step lands exactly on black. That is why the undershoot measures 0.3304 on both radius-3 rows while the overshoot climbs from 34.8 % to 46.1 % between them — the fixture ran out of room, not the filter out of effect. The undershoot column is capped above radius 2 and I have left it out of the table rather than print a number that has stopped responding.

Edge width against overshoot for nine sharpening settings, with the enlargement's own width as a floor

600 px into 2000 px

The case that actually happens. A 600 px edge enlarged to 2000 — 3.33× — and then sharpened, against a 2000 px edge that was never enlarged at all: rendered at 2000 and softened with a 0.7 px Gaussian, which puts its edge at 2.43 px and leaves no halo, because nothing in that path could put one there.

variant width px overshoot rings
shot at 2000 2.43 0.0 % 0
600 → 2000 2.87 10.6 % 3
+ radius 1, amount 0.5 2.50 13.3 % 3
+ radius 1, amount 1.0 2.16 16.5 % 5
+ radius 2, amount 1.0 1.56 19.1 % 5

Two readings, and they are the whole argument.

The plain 3.33× enlargement has a halo of 10.6 % with three rings, and a file that was shot at 2000 has neither. That is the fingerprint: a halo 20 luminance levels tall on an edge, in a file that claims to be native, means it was not. Not "might be": an unsharpened 2000 px capture has no 10 % overshoot, because nothing in the capture path put one there.

And the last row is 1.56 px — 36 % narrower than the 2.43 px edge of the file that was actually 2000 px. Whatever that file is, it is not a 2000 px photograph of the thing in the picture. There is no source of a 1.56 px edge at 2000 px anywhere in the pipeline except the sharpening.

The rule that falls out, and it is quantitative: measure the same edge before and after the enlargement. The width should grow with the scale factor — about 0.85 × N for Lanczos-3 on these fixtures, 3.41 px at 4× and 2.87 px at 3.33×. If the result is under 0.85 × N × (source width), the difference was added, and the halo tells you how much.

On real photos the halo is white

A synthetic step runs 0.12 to 0.86, so its bright plateau has 14 % of full scale of headroom above it — just enough for a 13 % overshoot to show up as a percentage. The sharpening fixture loosens that to 40 %. A real product photo has neither: the bright side of a bottle highlight is already at 250, and the overshoot does not read as 46 % of anything, it reads as pixels that are pure white.

Eight covers, each enlarged 4× and then sharpened, counted for pixels sitting on 0 or 255 that were not clipped in the master:

setting newly clipped dE vs master dE on edge band
4× enlargement only 0.28 % 1.51 4.01
radius 1, amount 0.5 0.39 % 1.52 3.97
radius 1, amount 1.0 0.52 % 1.57 3.97
radius 2, amount 1.0 1.30 % 1.77 4.10

The 4× enlargement on its own already clips 0.28 % of a photo, and it is the enlargement doing it: Lanczos-3 puts 11.7 % of the step height above the bright plateau, and a photograph's bright side is generally a lot closer to white than the 14 % of headroom this fixture gives it. Sharpening at radius 2 amount 1 multiplies that by 4.6, to 1.30 %, and the per-photo spread is wide: 0.06 % on the least affected of the eight, 4.34 % on the apparel shot with its cloth texture and specular highlights.

The dE columns are the part I expected to come out differently and did not. Every setting moves dE away from the master, on all eight photos, and the edge-band dE improves by 0.04 at the lightest setting — inside the noise of anything here. Sharpening this enlargement does not get closer to the truth. It trades distance for edge contrast at a rate that shows up in the clip count and not in the error.

Per-photo clipping after a 4x enlargement, before and after sharpening

The check you can run on a file you were sent

Everything above is a hundred lines of numpy on a grayscale profile. The part that matters for a supplier file is this, and it reproduces every overshoot and width in the tables above when pointed at those fixtures:

import numpy as np from PIL import Image def halo(path, trim=40): """Overshoot and width of a vertical edge. Row mean, no binning.""" a = np.asarray(Image.open(path).convert("L"), dtype=np.float64) / 255.0 p = a.mean(axis=0)[trim:-trim] # only valid if the edge is vertical lo, hi = np.median(p[:40]), np.median(p[-40:]) t = (p - lo) / (hi - lo) width = 1.0 / np.sum(np.diff(t) ** 2) # 1.00 for a hard step, N for an N-px ramp return float(t.max() - 1.0), float(width) 

Two numbers out: the overshoot above the plateau, and the width. Pointed at the four fixtures above it returns 0.0000 / 1.00 for the source edge, 0.1170 / 3.41 for the Lanczos-3 enlargement and 0.1330 / 3.24 for Lanczos-5, which is the table reproduced from a file on disk rather than from an array in memory.

The floor on that first number is quantisation: on a flat 8-bit plateau the residual is about one level, which is 0.005 of a 0.74 step. So anything under 0.01 is zero, and on a file that went through Lanczos it will sit at 0.10–0.13 with the width at the scale factor.

Practical caveats, because this is a fingerprint and not a proof: in-camera sharpening is the same unsharp mask, so a file that was sharpened in the camera also carries a halo and the two are not distinguishable by amplitude alone. The ring count helps — a sharpened edge is 3 or 5, bilinear and nearest are 0 — but the honest conclusion is that you can prove something was done, and you can often name which kernel, and you cannot always prove where in the chain it happened.

What I'd do

  • Measure the halo before you trust an edge width. Width alone is monotone in sharpening, which makes it the wrong gate.
  • Treat 10 % overshoot on a claimed-native file as evidence. An unsharpened capture has none.
  • Do not judge a kernel by its halo alone. Lanczos-5 has the biggest halo here and the lowest error against the master. The halo is a price, not a verdict.
  • Do not choose a sharpening radius by MTF50. It moved 17 % across a sweep that took the edge width down 68 %.
  • Count clipped pixels on your own photos. It is the version of the halo that anyone looking at the picture will see, and on these eight it moved by 4.6× between the default and a heavy pass.

The tool I use for the resize-and-sharpen step itself is the upscale and sharpen page — it is one of ours, and the numbers above are the reason it exposes the radius as a separate control rather than a single "sharpen" slider.

What this doesn't cover

No super-resolution models. There is no torch on this machine and no weights to audit, so every number here is about kernels. That is a real gap, and it is the interesting gap: a model with real priors can add information, and the only honest way to score it is against a high-resolution truth — a downsampled master, not another upscale. The instruments here would do that job; I did not have the model.

One edge, one polarity, one orientation. Dark subject on light background, vertical, luminance only. A light subject on dark flips the sign of the residual, and a horizontal edge would resample through the other axis.

sRGB, 8 bits. The filtering happens on gamma-encoded values, and the 8-bit quantisation is what sets the two-level dead zone on the ring counter. In linear light both the halo amplitude and the ring count would move.

Synthetic edges. The fingerprints are measured on generated steps, which is what makes them comparable to a closed form. On a real photo the same kernel meets texture, and the overshoot then depends on what the texture was doing. The photo section is the closest this gets to that, and it measures clipping rather than overshoot.

The fixture is 8-bit, so the numbers are too. A 0.6 percentage-point agreement between measured and closed form is close to the quantisation floor at a 0.74 step height, not a statement about the limit of the method.