Dev.to AI 🤖 Ai 👁 0 📖 14 min read

A Halftone Screen Is a Ruler: Upscaling a Print Divides the Dot Frequency by Exactly the Scale Factor

A magazine scan at 300 ppi, upscaled 4×, does not develop new edge detail and it does not develop new dot detail either. The dots that survive are the same dots, printed bigger, with a dot 0.68 mm wide where the print ha

A Halftone Screen Is a Ruler: Upscaling a Print Divides the Dot Frequency by Exactly the Scale Factor

A magazine scan at 300 ppi, upscaled 4×, does not develop new edge detail and it does not develop new dot detail either. The dots that survive are the same dots, printed bigger, with a dot 0.68 mm wide where the print had one 0.17 mm across (a 150 lpi dot at 4×). I measured this on fifteen synthetic screens across five pitches and three scale factors, and the output pitch matched p × F with a worst-case error of 0.56% — smaller than the quantisation of the measurement itself.

That single number explains most of what goes wrong when people enlarge printed material. It also destroys two things I assumed going in, which I'll show before I get to the advice.

Everything below comes from one measurement file, halftone_data.json, produced by halftone_measure_v2.py. Screens are modelled as an AM clustered-dot lattice: dot area fraction equals tone, radius p·√(tone/π), lattice rotated 45°, pitch p pixels at the source resolution. At 300 ppi a 150 lpi screen gives p = 2.
That AM clustered-dot geometry — dots of varying area on a fixed lattice, rotated so the four process colours sit on different angles — is the classic screening model described in the halftone literature and why the lattice angle is chosen at all (screen angle). Every figure in this article is read out of that file — nothing is estimated.

The screen is a clock, and the upscaler only changes the tick rate

A halftone screen is a periodic structure. Periodic structures have a frequency, and resampling is a frequency operation. So the question "what happens to the dots when I upscale" has a one-line answer: the dot frequency divides by the scale factor, and the dot pitch multiplies by it.

I built five screens on flat 50% grey — p = 2, 3, 4, 6, 8 pixels — and upscaled each at 2×, 3× and 4× with Lanczos. Then I located the dominant radial frequency in the spectrum, took its reciprocal, and compared it to the prediction.

source pitch p factor F predicted pitch (px) measured pitch (px) error
2 2× 4.00 3.99 +0.17%
2 4× 8.00 7.99 +0.17%
3 2× 6.00 5.97 +0.54%
3 4× 12.00 11.94 +0.54%
4 2× 8.00 7.99 +0.17%
6 2× 12.00 12.07 −0.56%
6 4× 24.00 24.14 −0.56%
8 4× 32.00 31.94 +0.17%

All fifteen runs. Three distinct error values appear in the whole table — +0.17%, +0.54%, −0.56% — and they are grouped by source pitch, not by scale factor. That is the signature of a discrete measurement: the peak-frequency bin is quantised, so a p = 3 screen is measured with a coarser relative resolution than a p = 2 screen. The error is in my estimator, not in the resampler. The resampler is doing exactly p × F.

Residual of measured output pitch against p × F, and dot contrast versus descreen sigma

The panel on the left plots the residual rather than the two curves on top of each other, because when the fit is this tight the overlay is a single line and tells you nothing. The panel on the right is the part that matters for a workflow: dot contrast as a function of how much Gaussian blur you apply before the resize. Hold that thought; it becomes the central trade-off of this article.

Here is the uncomfortable consequence. A 4× upscale of a 150 lpi screen produces a 37.5 lpi screen at the output. At 37.5 lpi, the individual dots are visible as dots — not as texture, as objects, at arm's length. You have not removed the screen. You have magnified it into something a person can point at.

What I expected: moiré clumping on flat grey

Before running the second experiment I wrote down the prediction. Resampling a periodic lattice at ratios that are not integer multiples should produce beat frequencies: screen pitch 3 at factor 2.5 is exactly the kind of non-commensurate ratio that generates moiré in print. A flat 50% grey is the harshest test, because there is no image content to hide the artefact behind. I expected envelope roughness in the several-percent range at 1.5× and 2.5×.

That is not what the data says. I averaged each output over three dot pitches — which cancels the dots themselves and leaves only the low-frequency envelope — then measured how much that envelope still moved. A perfect screen on flat grey gives 0. Across forty runs, nothing exceeded 2.98%, and the mean sat between 0.94% and 1.58%.

kernel mean envelope roughness max mean dot contrast
nearest 1.58% 2.98% 68.41
bilinear 0.94% 0.98% 46.46
bicubic 1.07% 1.16% 61.02
lanczos 1.13% 1.23% 68.02

(Values for p = 3; the p = 6 screen behaves the same way, 1.28% to 1.40%, because at that pitch the output pitch after resampling is large enough that no beat falls inside the analysis window.)

Two findings, both against my expectation:

First, there is no clumping to speak of. Nearest-neighbour is the worst offender at 2.98%, and it earns that number for a mundane reason — it duplicates pixels, so a 50% grey screen at 1.5× becomes an uneven mix of 1-pixel and 2-pixel runs. That is pixel duplication, not moiré. Every interpolating kernel stays at or below 1.23%.

Second, bilinear is not the "soft" kernel in this test — it is the kernel that already descreened the image. Nearest and Lanczos both keep dot contrast at 68 levels. Bilinear drops it to 46.46. A 1.5× bilinear resize of a screened image is, in effect, a partial descreen: it averages the dot into its neighbours and returns a flatter result. That is a cost when you want the dots gone and a catastrophe when you wanted the texture, and it happens whether you asked for it or not.

So the moiré story is not the story. The story is contrast, and the next two experiments pin down what contrast costs.

Descreening costs edge width, and the price is set by the screen pitch

If the dots are the problem, the obvious move is to blur them out before the resize. The question is what that blur does to the content you were trying to keep.

I built a screened step — solid ink at 0.90 on the left, near-paper at 0.10 on the right — which is a stand-in for any hard boundary in a printed photo: a product edge, a table line, the join between a suit and a wall. Then I applied a Gaussian of σ = 0 to 3.0 px, upscaled 2× with Lanczos, and measured two things on the output: the dot-band contrast left in the flat ink region, and the 10–90% rise width of the step.

screen pitch dot contrast at σ=0 σ needed for dot contrast < 6 edge width at σ=0 (src px) edge width after that σ (src px) edge widened
2 px 52.35 1.0 0.52 2.57 4.9×
3 px 69.41 1.5 0.49 3.37 6.9×
4 px 80.22 2.0 0.68 4.45 6.5×
6 px 95.70 2.5 0.33 5.53 16.8×

The 6-level threshold is my own: below roughly six levels of contrast a periodic structure stops reading as texture and starts reading as noise, and on an 8-bit file it is close to the point where JPEG quantisation would finish it off anyway.

The pattern is clean and it is bad. A coarser screen needs more blur to kill, and a coarser screen also has thinner recorded edges, because the same scan resolution that produced a p = 6 screen produced it from a coarser halftone that had already thrown the detail away. So the two numbers move against you together: the screen that is hardest to remove is the screen attached to the softest content. At p = 6 you pay a 16.8× widening of every edge in the file to make the dots go away.

A 0.33-pixel edge becomes a 5.53-pixel edge. In a 300 ppi scan, 5.53 pixels is 0.47 mm — visible as a soft halo around every boundary at normal viewing distance. That is not restoration. That is trading one artefact for a different one, and the second artefact is harder to explain to a client.

On real photographs the screen comes back louder than the paper ever had it

Synthetic steps are clean. Real photographs are not, so I repeated the comparison on three product images from the preset set — a clear-rendering shot, a cinema-vivid shot, and a true-texture shot — cropping the same 512×512 region from each, screening it at p = 2, 3, 4, upscaling 2×, and measuring three things:

  • tone error — does the local average still match the original tone, in 0–255 levels;
  • dot amplitude — the standard deviation of the dot-band component (the perceptual "screen" you see);
  • structure — gradient energy above the dot band, as a percentage of the unscreened 2× reference. 100% means "as much real edge as the clean image had"; above 100% means the resize invented edge energy.
arm mean dot amplitude mean tone error (levels) mean structure kept structure range
reference (unscreened) 7.40 — 100% —
bilinear, raw 38.94 24.79 97.2% 67.0–152.6%
bilinear, descreen 5.99 23.03 51.4% 46.3–63.9%
Lanczos, raw 57.20 25.61 129.6% 95.4–186.5%
Lanczos, descreen 8.46 23.02 54.5% 47.4–69.2%

Read the first data row against the reference row. The unscreened image has a dot-band amplitude of 7.40 levels — that is the natural fine texture of the photograph itself. Bilinear on the raw screen returns 38.94, 5.4× the reference once you average the per-run amplitude ratios. Lanczos returns 57.20, 8.2× on the same basis. The upscaler does not merely preserve the screen it was handed; it amplifies it, because interpolation between dot centres turns a binary-ish dot pattern into a smooth hump with more total variance than the dot had. The screen gets stronger.

The specific numbers are worth sitting with. On the clear-rendering shot at p = 2:

  • raw bilinear: dot amplitude 22.35 against a reference of 5.58;
  • raw Lanczos: dot amplitude 43.44 against the same 5.58;
  • bilinear after a σ = 0.67 px descreen (p/3): dot amplitude 6.88.

Descreen brings the dot amplitude from 4× the reference down to 1.2×. It works. But look at what happens to structure in the same table: 51.4% for bilinear-with-descreen, 54.5% for Lanczos-with-descreen. You get the dots under control by throwing away roughly half of the real edge energy in the image.

Dot-band amplitude by pitch and kernel, and structure kept versus dots left

The right-hand panel is the whole argument in one picture. There is no point on that plot in the desirable corner (low dots, high structure). The raw arms sit high and to the right: lots of dots, and structure numbers above 100% — which is not a win, it is fabricated edge energy. The descreen arms sit low and to the left: dots beaten back to near-reference, and real edges halved.

Why Lanczos "looks sharper" and is measurably worse

The raw Lanczos arm averages 129.6% structure and reaches 186.5% on the true-texture image at p = 4. A tool that reports "more edge energy than the clean original" has not recovered anything. The original is the ceiling. Everything past 100% is ringing: the negative lobes of the Lanczos kernel overshooting across each dot, manufacturing a bright halo on one side and a dark one on the other.

This is the mechanism behind a familiar disappointment. People upscale a magazine scan, see crispness appear, and conclude the enlargement worked. The crispness is the screen, amplified by negative lobes, with a ringing halo attached to every dot. Zoom in and the "detail" is a regular lattice; zoom out and it reads as coarse grain that was not in the print.

Measured against a clean reference, the raw arms also carry the worst tone error of the four — 24.79 and 25.61 levels, against 23.03 and 23.02 for the descreen arms. Descreening modestly improves tone accuracy, because smoothing lets each dot's local neighbourhood average out to the intended value instead of being dominated by the dot's own extremes. The failure of descreening is entirely in the structure column.

One more honest caveat: σ = p/3 is a fixed heuristic, not a tuned parameter. I did not sweep σ for each image in this experiment, so the descreen arms are one sample of the descreen trade-off, not its best case. What the sweep in the third section shows is that the trade-off curve exists and its slope worsens with pitch; where you choose to sit on that curve is a judgement, not a measurement.

The screen keeps travelling after you export

There is a second resample that nobody counts: the one the viewer's display does. I took a 1200×1200 screen, upscaled 2× to make the "master you would upload", then resized that master down to five display widths with Lanczos, measuring the surviving dot contrast.

source pitch at 2400 px at 1600 px at 1200 px at 800 px at 400 px
2 px pitch 4.00, contrast 45.17 pitch 2.67, 45.65 pitch 2.00, 39.24 pitch 1.50, 10.54 pitch 3.87, 3.40
3 px pitch 6.00, 68.14 pitch 4.00, 68.37 pitch 3.00, 69.36 pitch 2.00, 57.24 pitch 4.10, 1.81
4 px pitch 8.00, 78.30 pitch 5.34, 77.95 pitch 4.00, 77.57 pitch 2.67, 73.44 pitch 1.50, 11.71
6 px pitch 12.04, 93.63 pitch 8.02, 93.56 pitch 6.02, 92.97 pitch 4.01, 86.58 pitch 2.01, 71.53

The p = 2 row is the informative one. Contrast holds between 39 and 46 levels down to a 1200-pixel output, where the dot pitch is exactly 2 px. At 800 px the pitch falls to 1.5 px — below the two-pixels-per-cycle that the Nyquist–Shannon sampling theorem requires (the aliasing mechanism itself is described under signal aliasing), and contrast collapses to 10.54. At 400 px it is 3.4, which is to say gone.

The p = 6 row is the opposite. Even at 400 px, where the dot pitch is 2.01 px, contrast is still 71.53. A coarse screen survives an aggressive downscale because it has fewer cycles to lose. That is the same statement as before, seen from the other end: the coarser the screen, the more robust it is to every operation you apply, and the more work it takes to be rid of.

I have flagged the 400 px entries for p = 2 and p = 3 in bold because their reported pitch (3.87 and 4.10 px) is larger than the pitch at 2400 px. That is impossible as a physical statement and correct as a measurement: at those widths the dot frequency has aliased, and the "peak" the estimator finds is the alias, not the dot. The honest reading of those two cells is the contrast number, not the pitch.

When you should not upscale a halftone at all

The measurements define a narrow band where the operation is worth doing.

Do not upscale if the source is a coarse screen — anything at or below about 100 lpi in the original print, which at 300 ppi lands at p ≥ 3. The 16.8× edge widening at p = 6 is not recoverable by anything downstream, and the dots will be visible at the output regardless.

Do not upscale if the target is print at the same physical size. Halftone dots were the compression of the original print. Re-rendering them at a new screen is a job for a rescreening RIP with the dot structure intact, not for a generic interpolation kernel that will invent ringing across every dot.

Do not upscale if your plan is "blur first, then enlarge". That plan is exactly the bilinear-descreen arm: dots down to 5.99 against a 7.40 reference, tone error improved to 23.03 levels, and 48.6% of the real edge energy gone. If the image is a product shot, you have just deleted the product's edges.

Do upscale if the screen is fine relative to the scan — p = 2 at 300 ppi, i.e. 150 lpi or finer, which is what most commercial magazines and good book stock use — and if your target is on-screen viewing at 2× or less. In that band the tone error stays near 23 levels and the pitch behaves predictably, so a modest descreen buys you the dots without destroying the structure.

Do upscale if you can get a better source. This is not a dodge. A p = 2 screen at 300 ppi came from a print run; the printer had film or a PDF. Every number in this article is a description of what happens when you refuse to go find it.

your situation screen pitch in the scan right move
glossy magazine, 2× for screen 2 px light descreen, then 2× — dots drop from 4× to 1.2× reference
newsprint or cheap catalogue 4–6 px rescan at higher ppi, or accept soft edges; do not expect recovery
enlarging for print at the same size any rescreen in a RIP; generic upscalers make it worse
already-descreened file you found online unknown check for ringing first — structure above 100% means someone already Lanczos'd it
product shot where edges are the subject 2 px keep raw bilinear if contrast matters more than texture; accept the 5.4× dot amplification

A procedure that follows from the numbers

  1. Measure the pitch before you do anything. Load the scan, take an FFT of a flat region, find the dominant radial frequency, take its reciprocal. That number, in output pixels, is your p. It takes one line of numpy and it determines everything below.
  2. If p = 2, apply a descreen at σ ≈ 0.67 px (p/3) — that is the setting that took dot amplitude from 22.35 to 6.88 on the clear-rendering shot. Keep σ proportional to p; the σ needed to reach six levels of dot contrast was 1.0, 1.5, 2.0 and 2.5 px for p = 2, 3, 4, 6.
  3. Upscale at an integer factor. The pitch relationship p × F holds across factors 2, 3 and 4, but integer factors keep every dot on a whole-pixel boundary, which is the difference between a screen that looks like a bigger screen and one that looks like a beat pattern.
  4. Check structure before and after. Compute gradient energy above the dot band and compare it to the unscreened reference. If the output exceeds 100%, you have ringing, not detail — reduce the kernel's negative lobes or stop enlarging.
  5. Check contrast at your actual display width. Downscaling to 800 px killed a p = 2 screen (45.17 → 10.54) while leaving a p = 6 screen alive (86.58 → 71.53). The screen you removed on export can come back, or fail to, depending on the last resize in the chain.

Short checklist

  • [ ] Dominant dot frequency measured, p computed in output pixels
  • [ ] Screen class identified: fine (p ≤ 2), medium (p = 3), coarse (p ≥ 4)
  • [ ] Descreen σ set to p/3, not a fixed number
  • [ ] Scale factor an integer
  • [ ] Structure metric compared against the clean reference, not against the input
  • [ ] Explicitly decided that losing ~half the real edge energy is acceptable — or chosen not to descreen
  • [ ] Final display width checked for a contrast cliff

Try it on your own scan

The measurement above is reproducible on any file: the pitch, the structure ratio and the contrast cliff are all one FFT and two gradients away. If you want the upscale half of the pipeline handled for you, the upscaler at upgolab.com runs the resize and the preset selection, and the checklist above still applies — measure the pitch first, because the tool cannot know your source was a print.

The video is a 28-second pass through five presets on real product frames, which is the fastest way to see how much of the difference between presets is genuine structure and how much is edge contrast being pushed.

What the numbers actually said

I set out to write about moiré. The measurement said the moiré term is negligible on flat screens — 2.98% at worst, and that only because nearest-neighbour duplicates pixels — and that the real story is contrast: the upscaler amplifies a screen to 5.4–8.2× its reference amplitude, and the only way to get it back down is to give up roughly half the genuine edge energy in the file. That is a worse result than "moiré is the problem" because there is no correct answer in it, only a choice of which artefact you can live with. The numbers are in halftone_data.json if you want to check any of them.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.