Anamorphic SD Before Upscaling: Non-Square Pixels, 1.185× Stretch, Measured

A 720×480 anamorphic frame is a 16:9 picture stored on a grid that was squeezed horizontally. Everything about upscaling it changes when you accept that: how much detail exists, which axis runs out first, and — the part that bites — which upscale path your quality metric will wrongly prefer.

Measured 18 November 2026 · ffmpeg 6.1.1, Pillow 12.2.0, numpy 1.26 · known-answer masters built at 1920×1080 and pushed down through the anamorphic grid

The number that is not on any slider: 1.185×

Take a 16:9 picture and store it as 720×480. The vertical direction is straightforward — 480 samples across 9 units of picture height. The horizontal direction is not: you are putting 16 units of picture width into 720 samples. So the two axes are not sampled at the same density, and the encoder has to record how to stretch the result back out. That is the sample aspect ratio, and for 16:9 inside 720×480 it is 32:27.

Dividing through, the asymmetry is not a rounding detail:

QuantityValueWhat it means
Horizontal stretch to 19202.6667×720 → 1920
Vertical stretch to 10802.2500×480 → 1080
Ratio between them1.1852×32/27 — the SAR itself
Horizontal samples per unit width45.00720 ÷ 16
Vertical samples per unit height53.33480 ÷ 9
Horizontal ÷ vertical density0.8438the horizontal grid is 15.6% coarser

That last row is the whole article. The horizontal axis of an anamorphic SD frame is not merely stretched more on the way out — it genuinely carries 15.6% fewer samples per unit of picture than the vertical axis does. Whatever you do to it afterwards, that deficit was baked in at capture.

Experiment 1 — the correct upscale has a hard ceiling at 360 cycles/width

Build a known master at 1920×1080, push it down through 720×480 with SAR 32:27, then upscale back. Because the low-resolution copy is derived from a known original, everything below is a real error measurement rather than a comparison of two guesses.

The first question is not "how many decibels" but "how much detail can survive at all". A sampling grid of n samples can represent at most n/2 cycles across its full extent. For the horizontal axis of this frame that is 720/2 = 360 cycles per picture width, and for the vertical axis 480/2 = 240 cycles per picture height. Measured MTF50 (the frequency where contrast falls to half) of the correctly upscaled result:

PathH MTF50 (c/width)V MTF50 (c/pheight)px per cycle, Hpx per cycle, V
Correct: one non-uniform resample to 1920×1080355.0247.65.414.36
SAR kept, uniform 1620×1080362.5247.65.304.36
Assumed 3:2 square, 1440×960327.6243.75.864.43

The correct path reaches 355 cycles/width against a theoretical 360 — it is using 98.6% of the grid's capacity. There is nothing left to win there. Against a true 1920×1080 master, whose own Nyquist is 960 c/width and 540 c/pheight, the anamorphic ceiling is 360/960 = 37.5% of horizontal detail and 240/540 = 44.4% of vertical. And because 5.41 px/cycle is larger than 4.36 px/cycle, the horizontal direction starts 24.1% coarser in pixel terms even after a perfectly correct upscale.

The practical consequence. Upscaling an anamorphic 720×480 to 1080p cannot produce horizontal detail finer than 360 cycles across the frame, no matter which kernel or model you run. The correct upscale already achieves 98.6% of that. Any claim that a particular upscaler recovers horizontal detail here is a claim about the vertical axis, or it is wrong.

Experiment 2 — everything above 360 folds back, and it lands where you can see it

The ceiling would be harmless if detail above it simply disappeared. It does not. Content above the Nyquist frequency aliases: it reappears at |f − 360| as a lower frequency that was not in the original. I fed single-frequency sine gratings into the anamorphic grid, upscaled correctly, and read off the dominant frequency in the output:

Input (c/width)Output peakPredicted |f−360|Result
340340.0—passed through
355355.0—passed through
365355.0355folded
380340.0340folded
400320.0320folded
420300.0300folded
450270.0270folded
500220.0220folded
600120.0120folded
70020.020folded

Ten out of ten above-ceiling inputs folded, and every one landed exactly on |f − 360|. This matters because the folds land in the visible range: 400 c/width becomes 320 — comfortably inside the band a viewer reads as real texture. On this content that is not a subtle artefact, it is a new pattern that was never in the picture.

The fix has to happen before the grid is created, not after — upscaling cannot undo a fold, because by the time the upscaler sees it the fold is already a valid low frequency. But I have to report the measurement honestly, because it is a trade and not a free win. Pre-blurring the 1920×1080 master before the downscale reduces the alias amplitude, and it reduces in-band detail by a similar factor:

gblur σ200 c/width kept400 c/width alias keptalias ÷ in-band
none100.0%100.0%23.5%
0.888.6%67.9%18.0%
1.374.4%44.2%13.9%
2.054.5%25.2%10.9%
2.66740.7%17.5%10.1%

At σ=2.0 you keep 54.5% of the in-band 200 c/width signal and 25.2% of the alias — the ratio improves from 23.5% to 10.9%, so band-limiting genuinely favours signal over fold, but it is not selective free of charge. The honest framing: the fold is at a frequency you have already decided you cannot represent, so you spend in-band detail to remove it. If the source is a clean digital master, do not band-limit — the master's own content below 360 c/width is what you want and higher frequencies may not exist. If the source is a film transfer or a rescan where above-Nyquist grain is real, band-limiting earns its cost.

# the ceiling, and the fold, in one command each
ffmpeg -f lavfi -i testsrc=size=1920x1080:rate=1 -frames:v 1 ref.png

# build the anamorphic storage frame: 16:9 inside 720x480
ffmpeg -i ref.png -vf "scale=720:480:flags=lanczos,setsar=32/27" sd.png

# THE CORRECT UPSCALE: non-uniform, square pixels out, one pass
ffmpeg -i sd.png -vf "scale=1920:1080:flags=lanczos,setsar=1" ok.png

# what NOT to do - keep the squeezed metadata and let the player guess
ffmpeg -i sd.png -vf "setsar=1" bad.png

Experiment 3 — the metric prefers the wrong geometry, by a wide margin

Here is the part that cost me the most time. I built five upscale paths from the same anamorphic source and scored each with PSNR against the known master, plus a geometric check on a perfect circle in the frame (aspect 1.0000 = correct).

PathOutputKBPSNRCircle aspectError
Correct: 1920×1080, square pixels1920×10803635.331.1370.99830.17%
SAR kept, 1620×10801620×10803112.531.8250.99980.02%
Square-first, 853×480 then up1920×10803639.031.0110.99790.21%
Assumed 3:2 square, 1440×9601440×9602487.733.2770.844315.57%
Relabel only, no resample720×480633.854.1280.842715.73%

PSNR ranks the two geometrically broken paths first and second, and the do-nothing path wins by 23 dB. The correct path is fourth — 0.7 dB behind a version whose circles are 15.6% wrong, and 0.8 dB behind the SAR-preserving path that is genuinely correct.

This is not PSNR being stupid; it is PSNR answering the question I asked. I asked it to compare at each candidate's own resolution, which meant resizing the reference down to match. The do-nothing path at 720×480 is exactly the 720×480 downscale of the master — so of course it scores 54 dB. A harness that resizes the reference to fit the candidate will always pass the candidate that did nothing. The number was honest and the comparison was meaningless.

Rule. Against a known reference, PSNR is only valid when both images are in the same coordinate system. For anamorphic content that means: stretch both to the same display aspect first, or score geometry separately. A 15% aspect error costs 0.7 dB here — under a decibel of PSNR, and instantly obvious to any human looking at a circle.

Experiment 4 — the wrong geometry also looks like an efficiency win

The wrong path is not just a metrics problem: it produces a genuinely smaller file, which is exactly the kind of "improvement" that survives a code review. Encoding every path at matched JPEG quality:

Pathq2q4q8q15q25
Correct 1920×1080461.9257.7134.579.766.7
SAR kept 1620×1080420.0225.7114.667.456.7
Assumed 3:2 — 1440×960354.3188.190.552.244.3
Relabel only — 720×480133.951.820.814.912.8

The 3:2 path is 23% smaller than the correct one at q2 and 34% smaller at q25 — it is encoding fewer pixels, so it wins on bytes and on PSNR while being geometrically wrong. Two independent metrics agreeing on the wrong answer is how this ships.

Experiment 5 — sharpen the horizontal axis, and only that

If the horizontal direction is 24.1% coarser in pixel terms, the obvious move is horizontal sharpening. Measured on the correct upscale, one separable 1-D unsharp pass per axis at amount 0.9:

SettingH MTF50V MTF50H gainV gain
None355.0247.6——
Horizontal only, 0.9382.8247.6+7.83%0.00%
Vertical only, 0.9355.0259.30.00%+4.73%
Uniform (both axes), 0.9382.8259.3+7.83%+4.73%

The axes are cleanly separable — horizontal sharpening moves horizontal MTF50 by exactly 0.00% on the vertical axis and vice versa. And there is an asymmetry in the cost. Running the same sharpening on a flat grey patch, which contains no signal at all, measures how much of the upscaler's own ringing each axis amplifies:

Axis sharpenedRinging ×0.6×1.2×1.8
Horizontal only1.001.001.07
Vertical only1.291.581.90
Uniform1.291.581.90

On the flat field, the correct upscale already carries 0.089 units of high-pass energy vertically against 0.050 horizontally — the Lanczos overshoot sits predominantly on the vertical axis. So vertical sharpening amplifies an artefact, while horizontal sharpening amplifies almost nothing that was not signal. Horizontal-only sharpening buys the larger of the two MTF gains (+7.83% vs +4.73%) and is the one that does not inflate the ringing floor. That is a specific, non-obvious instruction for anamorphic content, and it falls straight out of the 15.6% sample-density deficit.

Experiment 6 — sharpening before the upscale costs you 2.7 dB

The tempting alternative is to pre-sharpen the 720×480 frame so the upscaler has more to work with. Measured against the same master, on a separate photo-plus-text scene from the one used above (absolute values are not comparable to Experiment 3):

ApproachPSNR vs master
Post-upscale, horizontal only (0.9)29.702
Post-upscale, uniform (1.2)29.552
Pre-sharpen on the 720 grid, amount 0.629.185
Pre-sharpen on the 720 grid, amount 1.227.572
Pre-sharpen on the 720 grid, amount 1.826.010

My first run of this used a grain-heavy synthetic scene and produced a spectacular 35 dB for pre-sharpening — a 5.4 dB win — because that scene's dominant noise sat above the grid's Nyquist and was being folded into broadband hash; sharpening it before the fold premultiplied exactly the thing that was going to alias. On the photo-plus-text scene above, the same amount costs 0.5 dB. Both numbers are real; they describe different content. The generalisation is the pattern, not the size: pre-sharpening at the storage resolution amplifies frequencies the grid cannot carry, so it depends entirely on how much content you have above 360 c/width. Sharpen after the upscale, and check what your scene contains before believing any single number here including mine.

Experiment 7 — the destretch width cancels out, and I was wrong about which one to pick

Advice in this space, including the version of this page published on 17 November, says a destretch has to land on an even width because 4:2:0 needs one. 720 × 32/27 = 853.3333, which is not an integer, so people round to 852 or 854 and move on. I measured what that rounding actually costs, and the answer is: nothing measurable in geometry. The reasoning that made me care about it was wrong, and the correction matters more than the number.

The argument for caring runs like this. Destretch 720 → 852 changes the horizontal scale by 852/853.3333 = 0.99844; destretch to 854 changes it by 1.00078. So the two routes should disagree about the final aspect ratio by 0.23%. That is a plausible-sounding error and it does not survive measurement. A two-stage pipeline ends at 1920×1080 with setsar=1, and once the second stage renormalises to square pixels on a fixed output grid, both the numerator and the denominator of the intermediate aspect are rescaled by the same factor. The intermediate width cancels. What survives is only the resampling loss of having touched the frame twice.

Measured on a master with two vertical edges 520.0 square-pixels apart (x = 100 and x = 620 in the 853.33-wide square-pixel frame), so the correct 1080p baseline is 520 × 2.25 = 1170.000 px. Edge positions are sub-pixel 50% crossings on a 41-row mean:

RouteLeft edgeRight edgeBaselineError
One pass, scale=1920:1080223.511394.171170.66+0.057%
Destretch 850 → 1080p223.441394.151170.71+0.061%
Destretch 852 → 1080p223.441394.231170.79+0.068%
Destretch 853 → 1080p223.491394.191170.70+0.060%
Destretch 854 → 1080p223.561394.081170.52+0.044%
Destretch 864×486 → 1080p223.551394.231170.67+0.058%
scale=1620:1080 then setsar=1188.501176.27987.77−15.575%

The spread across every even and odd destretch width is 0.024 percentage points — 0.28 px on a 1170 px baseline, which is a quarter of one output pixel. The 850-vs-854 choice is not a decision. Stripping the SAR is a decision: −15.58%, and the failure is identical to the one in Experiment 2 because it is the same mistake.

Correction to what this page said before. I previously framed the parity of the destretch width as a real constraint. It is a real constraint on the encoder, not on the image: measured across seven encoders at width 853, libx264 and libx265 refuse (width not divisible by 2), while ffv1, prores_ks, mpeg4, libvpx-vp9 and libaom-av1 all accept it. And on a two-stage pipeline the width does not need to be correct in the first place.

Experiment 8 — 4:2:0 quantises the chroma edge to a 2-pixel grid, and that is the real cost

If the destretch width cancels in geometry, does anything about it matter? One thing does: pad. Padding 720×480 to 1920×1080 leaves the sample-aspect-ratio tag describing the old grid, so the output is labelled 32:27 at 1920×1080, which ffprobe reports as DAR 512:243 = 2.107 — an 18.52% stretch error on top of whatever the padding did. Padding is the one operation in this list that changes the frame size without touching the ratio, so it is the one that poisons the tag. crop has the same failure: cropping to 640×480 keeps 32:27 and therefore reports a 1.5802 DAR for a 4:3 window.

The chroma grid is the other thing, and this one is a genuine limit rather than a preference. In 4:2:0 the chroma plane is half-width, so a chroma edge can only land on even output columns. Sweeping a luma-plus-chroma step across the frame and destretching to 854×480, the luma edge tracks the ideal position to within a pixel but the chroma edge quantises:

IdealLuma edgeChroma edgeChroma error
60.0559.9757.50−2.55
120.09119.33119.50−0.59
180.14179.74179.50−0.64
240.19239.13239.50−0.69
300.23299.59299.50−0.73
360.28360.10361.50+1.22
420.33419.38417.50−2.83
600.47599.67599.50−0.97

Luma mean error is −0.547 px (max 1.056). Chroma mean error is −0.967 px with a max of 2.83 px, and the residual after subtracting the luma error reaches 2.47 px. Every chroma value lands on a .50, i.e. on a chroma sample boundary, regardless of where the true edge is. That is the quantisation, and it is why a saturated edge on a strongly coloured subject can look 1–2 px out of register at 1080p while a luminance edge looks exact.

4:4:4 removes it. Same source, same destretch, pix_fmt=yuv444p: chroma error drops to 0.00 px at every phase, and the luma-vs-chroma offset measured on a disc edge goes from −2.00 px at 4:2:0 to −0.02 px. The catch is the one in the correction above — 4:4:4 is not a delivery format for most players, so this is an argument for measuring in 4:4:4 and delivering in 4:2:0, not for shipping 4:4:4 anamorphic SD to a phone.

The resampling cost of the extra pass is also smaller than the page previously claimed, and it depends entirely on how much of the scene sits near the 360 c/width ceiling. Measured as PSNR against the original 1920×1080 master, all comparisons forced through yuv444p so the chroma format does not enter the number:

SceneOne passDestretch 854ΔDestretch 852Δ
Gradient plus text36.02136.013−0.00836.011−0.010
Noise-heavy photo21.38121.372−0.00921.372−0.009
400 c/width grating14.98214.740−0.24214.737−0.245
Hard colour bars29.82529.587−0.23829.585−0.240

On ordinary content the second pass costs 0.008–0.010 dB, not the 0.126 dB this page quoted before — that figure did not reproduce on any of the four scenes above, so I have left it alone rather than replacing it with a number I cannot defend. The cost only becomes real (−0.24 dB) on content sitting at or above the storage grid's ceiling, which is the same content that is already being destroyed by the fold in Experiment 2. So the honest version is: a two-stage destretch is free on real footage and measurable only on synthetic content that was never going to survive anyway.

A number I nearly published. The first run of this comparison reported a +2.06 dB win for the 853-wide destretch. It was not the width — it was the pixel format. Comparing through yuv420p instead of yuv444p costs 2.07 dB on every route in this test (34.436 vs 36.509 for the one-pass upscale), which is 200× larger than any difference between destretch widths. A 2 dB "improvement" that tracks the pixel format is a measurement artefact, and it is the exact shape of error this whole page exists to warn about.

All of this is 0.1% territory and none of it is what makes anamorphic SD look bad. The 15.6% aspect error and the 360 cycles/width ceiling from Experiments 1–3 are what make it look bad. But the two errors are qualitatively different: the aspect error is unrecoverable, and the chroma quantisation is exactly one chroma sample, which is 2 px at 1080p and invisible at normal viewing distance on anything but a hard saturated edge. Fix the geometry first, and treat the parity of the destretch width as a non-issue — which is the opposite of what this page told you yesterday.

What this changes in practice

  1. Read the SAR before you touch the file. ffprobe -show_entries stream=sample_aspect_ratio,display_aspect_ratio. If SAR is not 1:1, your two axes have different sample densities and every axis-blind operation is now a choice.
  2. Upscale non-uniformly in one pass, and write square pixels out. scale=1920:1080,setsar=1. Destretching to a square-pixel intermediate first and then upscaling costs 0.008–0.010 dB on ordinary content (Experiment 7) — and the intermediate width does not matter, so pick an even one only because the encoder wants it. A two-pass that splits at 720×1080 instead measures within 0.006 dB of one pass — so the pass count is not what matters, the intermediate grid is.
  3. Do not strip SAR and hope the player stretches. A relabelled 720×480 shows circles at 0.8427 — 15.7% wrong — and if any downstream tool respects the new metadata, the error is permanent.
  4. Band-limit before the grid, never after. Aliasing above 360 c/width is irreversible; a blur on the source costs the same upper octave and removes the fold.
  5. Score geometry separately from PSNR. A circle, a square, or a known grid detects a 15% aspect error that costs less than one decibel.
  6. Never compare PSNR across different output resolutions. Resizing the reference to fit the candidate is how a 54 dB score gets attached to an image that did nothing.
  7. Sharpen horizontally. It is the coarser axis after the stretch, and it is the axis where the upscaler's ringing is not.

None of this is recoverable detail — the 720-horizontal-sample grid is a fact about the source, and 37.5% of a 1080p master's horizontal resolution is what it can carry. What is recoverable is the geometry, and getting that right is worth more than any sharpening amount: a 15.6% aspect error is immediately visible, while the difference between the best and worst kernel on this content is under a decibel. If your frame is already square-pixel and you are choosing how far to go, the upscaler at upgolab.com keeps the aspect ratio locked by default — which is the one decision this whole page is about.

Reproducing the width test

This prints the table from Experiment 7. Write a 720×480 frame with two vertical edges 520 square-pixels apart, then measure the distance between them after each route. The reference is 1170 px because 520 × 2.25 = 1170 and the output is 1080 tall.

import subprocess, numpy as np, io, json
from PIL import Image

H, W = 480, 720
SAR = 32 / 27

def ff(*a):
    r = subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", *a],
                       capture_output=True)
    return r.returncode

def load(p):
    r = subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-i", p,
                        "-frames:v", "1", "-f", "image2pipe", "-vcodec", "png", "-"],
                       capture_output=True)
    return np.asarray(Image.open(io.BytesIO(r.stdout)).convert("RGB")).astype(float)

def cross50(prof):
    n = (prof - prof.min()) / (prof.max() - prof.min()); T = 0.5
    for i in range(1, len(n)):
        if n[i-1] < T <= n[i]:
            return i - 1 + (T - n[i-1]) / (n[i] - n[i-1])

# --- two luma edges 520 square-pixels apart ---
rgb = np.full((H, W, 3), 60, np.uint8)
rgb[:, int(100/SAR):int(620/SAR)] = [200, 200, 200]
Image.fromarray(rgb).save("edges.png")
ff("-i", "edges.png", "-vf", f"setsar={SAR:.12f}", "-c:v", "ffv1",
   "-pix_fmt", "yuv420p", "edges.mkv")

ROUTES = {
    "one pass 1920x1080":      "scale=1920:1080:flags=lanczos,setsar=1",
    "destretch 852 -> 1080p":  "scale=852:480:flags=lanczos,setsar=1,"
                               "scale=1920:1080:flags=lanczos,setsar=1",
    "destretch 854 -> 1080p":  "scale=854:480:flags=lanczos,setsar=1,"
                               "scale=1920:1080:flags=lanczos,setsar=1",
    "strip SAR at 1620 width": "scale=1620:1080:flags=lanczos,setsar=1",
}
print(f"{'route':24s} {'baseline px':>12s} {'error %':>9s}")
for name, vf in ROUTES.items():
    ff("-i", "edges.mkv", "-vf", vf, "-pix_fmt", "yuv444p", "-c:v", "ffv1", "out.mkv")
    probe = json.loads(subprocess.run(
        ["ffprobe", "-v", "error", "-select_streams", "v", "-show_entries",
         "stream=width,height,sample_aspect_ratio", "-of", "json", "out.mkv"],
        capture_output=True, text=True).stdout)["streams"][0]
    n, d = probe["sample_aspect_ratio"].split(":")
    sar = float(n) / float(d)
    a = load("out.mkv")
    g = (0.299 * a[:, :, 0] + 0.587 * a[:, :, 1] + 0.114 * a[:, :, 2])
    prof = g[a.shape[0]//2 - 20 : a.shape[0]//2 + 20].mean(axis=0)
    nn = (prof - prof.min()) / (prof.max() - prof.min())
    cross = [i - 1 + abs(0.5 - nn[i-1]) / abs(nn[i] - nn[i-1])
             for i in range(1, len(nn))
             if (nn[i-1] < 0.5 <= nn[i]) or (nn[i-1] >= 0.5 > nn[i])]
    base = (cross[-1] - cross[0]) * sar
    expect = 1170.0 * probe["height"] / 1080
    print(f"{name:24s} {base:12.2f} {(base-expect)/expect*100:8.3f}%")

Output on ffmpeg 6.1.1: one pass 1170.68 (+0.058%), destretch to 852 1170.77 (+0.066%), destretch to 854 1170.51 (+0.043%), and scale=1620:1080,setsar=1 987.78 (−15.575%). The three correct routes agree to within 0.28 px; the SAR-stripped one is off by 182 px. Change 852 and 854 to anything even and the first three stay inside a quarter of a pixel — that is the whole point.

Reproducing it

Every number above comes from a known master, so you can regenerate it exactly rather than trusting my output. The full measurement script:

import numpy as np, subprocess
from PIL import Image, ImageDraw, ImageFilter

W, H = 1920, 1080
DOWN = "scale=720:480:flags=lanczos,setsar=32/27"
UP   = "scale=1920:1080:flags=lanczos,setsar=1"

def ff(*a):
    subprocess.run(["ffmpeg", "-y", "-loglevel", "error", *a], check=True)

def load(p):
    return np.asarray(Image.open(p).convert("RGB")).astype(np.float64)

# --- known master with structure at several scales ---
rng = np.random.default_rng(23)
t = rng.normal(0, 1, (H, W)).astype(np.float32)
ti = Image.fromarray(((t - t.min()) / t.ptp() * 255).astype(np.uint8))
im = Image.merge("RGB", [ti, ti.rotate(90),
                         ti.transpose(Image.FLIP_LEFT_RIGHT)]).filter(
         ImageFilter.GaussianBlur(1.1))
d = ImageDraw.Draw(im)
for i in range(18):
    x0, y0 = int(rng.integers(50, W - 500)), int(rng.integers(50, H - 200))
    d.text((x0, y0), "SAR 32:27", fill=(252, 252, 252))
    d.rectangle([x0, y0, x0 + 300, y0 + 120], outline=(255, 255, 255), width=3)
im.save("ref.png")
ff("-i", "ref.png", "-vf", DOWN, "sd.png")

# --- the aliasing table: single-frequency gratings above the 360 c/width ceiling ---
y, x = np.mgrid[0:H, 0:W]
for f in [340, 355, 365, 380, 400, 420, 450, 500, 600, 700]:
    v = (128 + 85 * np.sin(2 * np.pi * f * x / W)).astype(np.uint8)
    Image.fromarray(np.dstack([v, v, v])).save("g.png")
    ff("-i", "g.png", "-vf", DOWN + "," + UP, "go.png")
    a = load("go.png").mean(2)
    r = a[a.shape[0] // 2]; r = r - r.mean()
    S = np.abs(np.fft.rfft(r * np.hanning(len(r))))
    fr = np.fft.rfftfreq(len(r)) * W
    i = np.argmax(S[5:]) + 5
    print(f"{f:4d} c/width -> peak {fr[i]:6.1f}  (predicted |f-360| = {abs(f-360)})")

That prints the fold table verbatim: 365→355, 380→340, 400→320, 420→300, 450→270, 500→220, 600→120, 700→20. Swap setsar=32/27 for setsar=1 and the whole table collapses — which is the point: the ceiling is a property of the stored grid, not of the source picture.

To check the geometry claim on your own file, draw a circle in a 1920×1080 test frame, put it through your pipeline, and measure the bounding box of the result. Aspect 1.000 is correct; 0.84 means the horizontal direction never got the stretch it was owed.