Downsampling Kernel Research

Background

  1. Gaussian blur optimizes large-radius blurring through downsampling -> small-kernel blur -> upsampling.
  2. After downsampling with a Box2x2 kernel, high-frequency image signals flicker temporally during motion.
Sinc function, coordinate axes, and grid used to demonstrate downsampling aliasing

Comparison

Box2x2 single pass (GPU bilinear)
1/4
1/4
1/4
1/4
Box2x2 three passes (GPU bilinear)
1/4
1/4
1/4
1/4
CrossBox three passes
0
1/16
1/16
0
1/16
2/16
2/16
1/16
1/16
2/16
2/16
1/16
0
1/16
1/16
0

CrossBox still performs only four texture samples in the shader, but each tap falls between four texels in the previous level. Expanding GPU bilinear interpolation onto discrete texels gives the following effective single-pass kernel:

hCross(1)=116[0110122112210110].h_{\mathrm{Cross}}^{(1)} = \frac{1}{16} \begin{bmatrix} 0&1&1&0\\ 1&2&2&1\\ 1&2&2&1\\ 0&1&1&0 \end{bmatrix}.

All subsequent CrossBox plots use this kernel, which already includes the linear sampler footprint.

Problem Definition

Let P\mathcal P denote the complete "downsample -> blur -> upsample" operator. Let p=p(t)\mathbf p=\mathbf p(t) be the image's displacement from its initial position at time tt, and define the translation operator in original-image coordinates as

(Tpf)(x)=f(x−p).(\mathcal T_{\mathbf p}f)(\mathbf x) = f(\mathbf x-\mathbf p).

Frame tt is then ft(x)=(Tp(t)f)(x)f_t(\mathbf x)=(\mathcal T_{\mathbf p(t)}f)(\mathbf x). The requirement that "no flickering occurs during translation" can be stated as

P(Tpf)=Tp(Pf),∀p\boxed{ \mathcal P(\mathcal T_{\mathbf p}f) = \mathcal T_{\mathbf p}(\mathcal P f), \qquad \forall\mathbf p }

The left side means "translate the original image, then run the full pipeline"; the right side means "run the full pipeline, then translate the result."

Move, then blur
𝒫(Tf)
Loading image…
Blur, then move
T(𝒫f)
Loading image…

Analysis

Consider the blur pipeline first. It involves two different coordinate systems: x\mathbf x denotes original-image coordinates, and k\mathbf k denotes discrete coordinates in the low-resolution image:

f(x)→ D d(x)→ III⁡ ⁣↓M ds(x)→ ↓M d[k]→ G g[k]→ ↑M gs(x)→ U f′(x).f(\mathbf x) \xrightarrow{\ D\ } d(\mathbf x) \xrightarrow{\ \operatorname{III}\!\downarrow_M\ } d_s(\mathbf x) \xrightarrow{\ \downarrow_M\ } d[\mathbf k] \xrightarrow{\ G\ } g[\mathbf k] \xrightarrow{\ \uparrow_M\ } g_s(\mathbf x) \xrightarrow{\ U\ } f'(\mathbf x).

The symbols above represent:

  • DD is the downsampling convolution with kernel hh before decimation. Throughout the rest of this article, hh refers to the effective weights that texture sampling actually applies to discrete pixels in the previous level: if a sample position falls between pixels, GPU linear interpolation is first expanded onto the neighboring pixels, and the weights of all samples are then summed;
  • III⁡ ⁣↓M\operatorname{III}\!\downarrow_M is impulse sampling at intervals of MM, with the result still expressed in original-image coordinates. It includes the fixed phase of the actual sampling grid, which will be written explicitly below;
  • ↓M\downarrow_M compacts the sparse impulse weights into a low-resolution image;
  • GG is Gaussian blur on the low-resolution image;
  • ↑M\uparrow_M places the low-resolution pixels back into original-image coordinates, inserting empty values between samples;
  • UU is the upsampling convolution with reconstruction kernel τ\tau.

The signals above are shown below.

Original image

Original image f(x)f(\mathbf x)

Original image convolved with the effective three-pass Box2x2 kernel

Downsampling convolution d(x)=(Df)(x)d(\mathbf x)=(Df)(\mathbf x)

Sparse impulses produced by multiplying the convolution result by a 2D comb with eight-pixel spacing; impulses are enlarged for visibility

Impulse sampling ds(x)d_s(\mathbf x)

Empty pixels between comb samples discarded and the remainder rearranged into a 64-by-64 low-resolution image

Downsampling rearrangement d[k]d[\mathbf k]

A 64-by-64 low-resolution image after 7-by-7 Gaussian blur with standard deviation 1.5

Low-resolution blur g[k]=(Gd)[k]g[\mathbf k]=(Gd)[\mathbf k]

Gaussian-blurred low-resolution pixels placed back into original-image coordinates with zeros inserted between samples

Upsampling rearrangement gs(x)g_s(\mathbf x)

Upsampled reconstruction produced by convolving the zero-inserted sparse image with a triangular kernel

Reconstruction convolution f′(x)=(Ugs)(x)f'(\mathbf x)=(Ug_s)(\mathbf x)

For convenience, the derivations below omit the independent variable (x)(\mathbf x) for signals in original-image coordinates, writing them simply as f,d,ds,gs,f′f,d,d_s,g_s,f'. Only low-resolution images explicitly show their discrete coordinates: d[k]d[\mathbf k] and g[k]g[\mathbf k].

Decomposing P\mathcal P

Returning to our proposition:

P(Tpf)=Tp(Pf),∀p\mathcal P(\mathcal T_{\mathbf p}f) = \mathcal T_{\mathbf p}(\mathcal P f), \qquad \forall\mathbf p

We need to fully expand P\mathcal P, then try to move the translation operator Tp\mathcal T_{\mathbf p} from right to left through each processing step. Following the pipeline above, P\mathcal P is

P=U∘↑M∘G∘↓M∘(III⁡ ⁣↓M)∘D.\mathcal P = U \circ\uparrow_M \circ G \circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D.

Therefore, sending the translated image through this chain gives

P(Tpf)=U∘↑M∘G∘↓M∘(III⁡ ⁣↓M)∘D(Tpf),P∘Tp=U∘↑M∘G∘↓M∘(III⁡ ⁣↓M)∘D∘Tp.\begin{aligned} \mathcal P(\mathcal T_{\mathbf p}f) &= U\circ\uparrow_M\circ G\circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D(\mathcal T_{\mathbf p}f),\\ \mathcal P\circ\mathcal T_{\mathbf p} &= U\circ\uparrow_M\circ G\circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D\circ\mathcal T_{\mathbf p}. \end{aligned}

Our goal is to determine whether the rightmost Tp\mathcal T_{\mathbf p} can move all the way to the left, ultimately yielding Tp∘P\mathcal T_{\mathbf p}\circ\mathcal P. We can now check whether Tp\mathcal T_{\mathbf p} can pass through each operator in turn. Here, DD uses the actual effective kernel hh defined above. Since GPU linear interpolation is already included in hh, DD remains a convolution operator and commutes exactly with translation in original-image coordinates:

D∘Tp=Tp∘D.D\circ\mathcal T_{\mathbf p} = \mathcal T_{\mathbf p}\circ D.

Impulse sampling and the downsampling rearrangement convert the signal from original-image coordinates to low-resolution coordinates, so these two operations must be examined together. After MM-fold downsampling, displacement p\mathbf p in the original image should correspond to displacement p/M\mathbf p/M in low-resolution coordinates. Below, Tp/M(ℓ)\mathcal T^{(\ell)}_{\mathbf p/M} denotes an ideal continuous translation in low-resolution coordinates.

The low-resolution convolution GG likewise commutes exactly with translation in its coordinate system:

G∘Tp/M(ℓ)=Tp/M(ℓ)∘G.G\circ\mathcal T^{(\ell)}_{\mathbf p/M} = \mathcal T^{(\ell)}_{\mathbf p/M}\circ G.

Finally, ↑M\uparrow_M and UU together return the signal to original-image coordinates. The required commutation relation is

U∘↑M∘Tp/M(ℓ) =? Tp∘U∘↑MU \circ \uparrow_M \circ \mathcal T^{(\ell)}_{\mathbf p/M} \ \stackrel{?}{=}\ \mathcal T_{\mathbf p} \circ U \circ \uparrow_M

The movement of the translation operator through the entire chain can therefore be summarized as

P∘Tp=U∘↑M∘G∘↓M∘(III⁡ ⁣↓M)∘D∘Tp=U∘↑M∘G∘↓M∘(III⁡ ⁣↓M)∘Tp∘D=?U∘↑M∘G∘Tp/M(ℓ)∘↓M∘(III⁡ ⁣↓M)∘D=U∘↑M∘Tp/M(ℓ)∘G∘↓M∘(III⁡ ⁣↓M)∘D=?Tp∘U∘↑M∘G∘↓M∘(III⁡ ⁣↓M)∘D=Tp∘P.\begin{aligned} \mathcal P\circ\boxed{\mathcal T_{\mathbf p}} &= U\circ\uparrow_M\circ G\circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D\circ\boxed{\mathcal T_{\mathbf p}}\\ &= U\circ\uparrow_M\circ G\circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ\boxed{\mathcal T_{\mathbf p}}\circ D\\ &\stackrel{?}{=} U\circ\uparrow_M\circ G \circ\boxed{\mathcal T^{(\ell)}_{\mathbf p/M}} \circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D\\ &= U\circ\uparrow_M \circ\boxed{\mathcal T^{(\ell)}_{\mathbf p/M}}\circ G \circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D\\ &\stackrel{?}{=} \boxed{\mathcal T_{\mathbf p}} \circ U\circ\uparrow_M\circ G\circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D\\ &= \boxed{\mathcal T_{\mathbf p}}\circ\mathcal P. \end{aligned}

Set GG, ↑M\uparrow_M, and UU aside for now and focus on the first question mark:

↓M∘(III⁡ ⁣↓M)∘D∘Tp =? Tp/M(ℓ)∘↓M∘(III⁡ ⁣↓M)∘D.\boxed{ \downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D\circ\mathcal T_{\mathbf p} \ \stackrel{?}{=}\ \mathcal T^{(\ell)}_{\mathbf p/M} \circ\downarrow_M \circ\bigl(\operatorname{III}\!\downarrow_M\bigr) \circ D. }

In other words, "downsample, then translate" and "translate, then downsample" must produce identical results.

Moving into the Frequency Domain

A 2D image simply repeats the same process in the horizontal and vertical directions, so for now we treat dd as a 1D signal and abbreviate displacement p\mathbf p as pp. Hats will denote Fourier transforms throughout: f^=F{f}\widehat f=\mathcal F\{f\}.

The rest of the analysis relies on three frequency-domain properties:

  1. Translating signal dd by pp adds only a phase term to its spectrum:
F{Tpd}(ω)=e−iωpd^(ω).\mathcal F\{\mathcal T_p d\}(\omega) = e^{-i\omega p}\widehat d(\omega).
  1. A comb function with spacing MM remains a comb function in the frequency domain, with spectral copies separated by 2π/M2\pi/M. Actual GPU downsampling also has a fixed sampling phase: for a single 2x downsample, output pixel centers are located at 2k+0.52k+0.5 in the previous level. After LL consecutive passes, M=2LM=2^L, and the sampling positions in original-image coordinates are
xk=kM+aM,aM=M−12.x_k=kM+a_M, \qquad a_M=\frac{M-1}{2}.

For example, after three 2x downsampling passes, M=8M=8 and the sampling grid is 8k+3.58k+3.5. We therefore use a comb function with phase:

III⁡M,aM(x)=∑k∈Zδ(x−aM−kM),\operatorname{III}_{M,a_M}(x) = \sum_{k\in\mathbb Z}\delta(x-a_M-kM),

Its Fourier transform is

F{III⁡M,aM}(ω)=2πM∑r∈Ze−i2πrMaMδ(ω−2πrM).\mathcal F\{\operatorname{III}_{M,a_M}\}(\omega) = \frac{2\pi}{M} \sum_{r\in\mathbb Z} e^{-i\frac{2\pi r}{M}a_M} \delta\left(\omega-\frac{2\pi r}{M}\right).
  1. After MM-fold downsampling, the range that the low-resolution image can represent without aliasing in original-image frequency coordinates is the baseband ∣ω∣<π/M|\omega|< \pi/M.

Therefore, "translate first, then sample" produces the spectrum

d^s,p(ω)=e−iωpM∑r∈Ze−i2πrMaMei2πrMpd^(ω−2πrM).\widehat d_{s,p}(\omega) = \frac{e^{-i\omega p}}{M} \sum_{r\in\mathbb Z} e^{-i\frac{2\pi r}{M}a_M} e^{i\frac{2\pi r}{M}p} \widehat d\left(\omega-\frac{2\pi r}{M}\right).

For "sample first, then translate," every spectral copy should receive the same phase:

d^s,p ideal(ω)=e−iωpM∑r∈Ze−i2πrMaMd^(ω−2πrM).\widehat d_{s,p}^{\,\mathrm{ideal}}(\omega) = \frac{e^{-i\omega p}}{M} \sum_{r\in\mathbb Z} e^{-i\frac{2\pi r}{M}a_M} \widehat d\left(\omega-\frac{2\pi r}{M}\right).

The fixed sampling phase e−i2πraM/Me^{-i2\pi r a_M/M} appears in both paths, so it does not affect whether they are equal. The only difference remains the factor produced by the input displacement:

ei2πrMp.\boxed{ e^{i\frac{2\pi r}{M}p}. }

For the baseband spectrum, r=0r=0, this factor always equals 11.

When the displacement happens to be an integer multiple of MM, all additional phases equal 11:

ei2πrM(mM)=ei2πrm=1.e^{i\frac{2\pi r}{M}(mM)} = e^{i2\pi rm} =1.

For the equality to hold for any displacement pp, only the r=0r=0 term can remain in the baseband. In other words, the signal after downsampling convolution must satisfy

d^(ω)=0,∣ω∣≥πM.\boxed{ \widehat d(\omega)=0, \qquad |\omega|\geq\frac{\pi}{M}. }

π/M\pi/M is the Nyquist frequency for sampling interval MM. For a 2D image, the corresponding alias-free region is

NM={(ωx,ωy)  |  ∣ωx∣<πM,  ∣ωy∣<πM}.\mathcal N_M = \left\{ (\omega_x,\omega_y) \;\middle|\; |\omega_x|<\frac{\pi}{M}, \; |\omega_y|<\frac{\pi}{M} \right\}.

Therefore, the condition for the downsampling stage to remain consistent under arbitrary continuous translations is

d^(ω)=0,ω∉NM.\boxed{ \widehat d(\boldsymbol\omega)=0, \qquad \boldsymbol\omega\notin\mathcal N_M. }

Since

d=h∗f⟺d^=h^ f^,d=h\ast f \qquad\Longleftrightarrow\qquad \widehat d=\widehat h\,\widehat f,

the condition that actually needs to hold for this particular image is

h^(ω)f^(ω)=0,ω∉NM.\boxed{ \widehat h(\boldsymbol\omega) \widehat f(\boldsymbol\omega)=0, \qquad \boldsymbol\omega\notin\mathcal N_M. }

If we want this conclusion to hold for any input image, we can only require the downsampling kernel itself to satisfy

h^(ω)=0,ω∉NM.\widehat h(\boldsymbol\omega)=0, \qquad \boldsymbol\omega\notin\mathcal N_M.

In other words, the ideal downsampling kernel is an ideal low-pass filter. Although this cannot be realized in practice, it gives us a way to analyze error: minimizing energy beyond the Nyquist limit reduces the visual artifacts caused by aliasing.

The problem therefore becomes finding a sufficiently good low-pass filter (downsampling kernel) that attenuates energy beyond the Nyquist limit.

Examining the Nyquist Region in Spectrum Plots

The cyan square marks the Nyquist region for a total of 8×8\times downsampling:

N8={(ωx,ωy)  |  ∣ωx∣<π8,  ∣ωy∣<π8}.\mathcal N_8 = \left\{ (\omega_x,\omega_y) \;\middle|\; |\omega_x|<\frac{\pi}{8}, \; |\omega_y|<\frac{\pi}{8} \right\}.

The square contains the frequencies that the low-resolution image can represent uniquely. Any energy remaining outside the square folds back into it after decimation.

Fourier magnitude spectrum of the original image, with a cyan square marking the Nyquist region for 8x downsampling

Original-image spectrum ∣f^∣|\widehat f|

Fourier magnitude spectrum after one 2-by-2 Box convolution of the original image, marking the Nyquist region for 8x downsampling

Single-pass Box2x2: ∣h^Box(1)f^∣|\widehat h_{\mathrm{Box}}^{(1)}\widehat f|

Fourier magnitude spectrum after three 2-by-2 Box convolutions of the original image, marking the Nyquist region for 8x downsampling

Three-pass Box2x2: ∣h^Box(3)f^∣|\widehat h_{\mathrm{Box}}^{(3)}\widehat f|

Fourier magnitude spectrum after three-pass CrossBox convolution of the original image, marking the Nyquist region for 8x downsampling

Three-pass CrossBox: ∣h^Cross(3)f^∣|\widehat h_{\mathrm{Cross}}^{(3)}\widehat f|

Single-pass Box2x2 retains nearly all the original image's frequency energy near the square's edges. Three-pass Box2x2 substantially reduces energy outside the square, but regular side lobes remain visible. CrossBox's actual response also includes each pass's GPU bilinear footprint and an additional direction-dependent factor of (cos⁡ωx+cos⁡ωy)/2\left(\cos\omega_x+\cos\omega_y\right)/2. The area outside the square is therefore darker overall, but its passband also attenuates more than Box2x2.

These four plots directly illustrate the condition derived above:

h^(ω)f^(ω)≈0,ω∉N8.\widehat h(\boldsymbol\omega) \widehat f(\boldsymbol\omega) \approx0, \qquad \boldsymbol\omega\notin\mathcal N_8.

The darker the area outside the square, the less energy can fold back into the baseband carrying displacement-dependent phase, and the weaker the flickering during motion.

Additional Issues

Bug in the Current Implementation

The current implementation performs only a single pass of GPU bilinear interpolation, providing almost no attenuation outside the Nyquist region. Aliasing becomes more severe at higher downsampling levels.

Single-pass Box2x2 effective kernel
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1/4
1/4
0
0
0
0
0
0
1/4
1/4
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Spectrum after one 2-by-2 Box convolution of the original image, marking the Nyquist region for 8x downsamplingSpectrum after one 2-by-2 Box convolution of the original image, marking the Nyquist region for 8x downsampling

Are There Better Kernels?

Each row shows, from left to right:

  1. The effective spatial weights produced by composing three convolution passes;
  2. The frequency response of the effective kernel itself, ∣h^K(3)∣|\widehat h_K^{(3)}|;
  3. The spectrum of the original image after convolution with the effective kernel, ∣h^K(3)f^∣|\widehat h_K^{(3)}\widehat f|.

The effective spatial kernels are drawn at their actual support sizes. Taps in the fixed 2×22\times2 even-sized kernel fall at texel centers, expanding to 8×88\times8 after three passes. Taps in the fixed 3×33\times3 and 5×55\times5 odd-sized kernels fall at half-texel positions, so GPU bilinear interpolation first expands them to 4×44\times4 and 6×66\times6, and their three-pass effective support sizes are 22×2222\times22 and 36×3636\times36, respectively. The two procedural Lanczos kernels have support sizes of 78×7878\times78 and 134×134134\times134. Warm colors indicate positive weights and blue indicates negative weights. Each spatial plot normalizes its colors by its own maximum absolute weight and is intended only to show weight shape and sign distribution. The cyan squares in the latter two columns still mark the Nyquist region for a total of 8×8\times downsampling, and all convolution results use the same logarithmic brightness range as above.

Every row shows the weights that the renderer actually applies to discrete texels in the previous level. For odd-sized fixed matrices, this includes the hardware linear sampler's 2×22\times2 footprint. The Lanczos rows use the discrete weights that the renderer actually generates for a scale factor of 22 and half-pixel phase. Boundary addressing modes are excluded from this frequency analysis, which assumes an infinite, translation-invariant domain. The CrossBox row uses exactly the same 4×44\times4 single-pass effective kernel as the three-pass CrossBox discussed above.

Effective spatial kernel
Effective response ∣h^K(3)∣|\widehat h_K^{(3)}|
Convolved spectrum ∣h^K(3)f^∣|\widehat h_K^{(3)}\widehat f|

Box2x2

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge Box2x2 presetEffective frequency response after three consecutive 2x downsampling passes with the NodeForge Box2x2 preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge Box2x2 effective kernel

Box3x3

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge Box3x3 presetEffective frequency response after three consecutive 2x downsampling passes with the NodeForge Box3x3 preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge Box3x3 effective kernel

CrossBox

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge CrossBox presetEffective frequency response after three consecutive 2x downsampling passes with the NodeForge CrossBox preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge CrossBox effective kernel

Gaussian3x3

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge Gaussian3x3 presetEffective frequency response after three consecutive 2x downsampling passes with the NodeForge Gaussian3x3 preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge Gaussian3x3 effective kernel

Gaussian5x5

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge Gaussian5x5 presetEffective frequency response after three consecutive 2x downsampling passes with the NodeForge Gaussian5x5 preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge Gaussian5x5 effective kernel

Lanczos3

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge Lanczos3 presetEffective frequency response after three consecutive 2x downsampling passes with the NodeForge Lanczos3 preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge Lanczos3 effective kernel

Lanczos5

Effective spatial weights after three consecutive 2x downsampling passes with the NodeForge Lanczos5 preset, with blue cells indicating negative weightsEffective frequency response after three consecutive 2x downsampling passes with the NodeForge Lanczos5 preset, marking the Nyquist region for 8x downsamplingSpectrum of the original image after convolution with the three-pass NodeForge Lanczos5 effective kernel

These plots directly compare the effective behavior of seven presets in the same three-pass pipeline with a total of 8×8\times downsampling. The corrected Lanczos3/5 kernels exhibit the expected approximate brick-wall low-pass response: nearly flat inside the cyan square, a transition concentrated near its boundary, and mostly black outside it.

At the horizontal cutoff boundary ωx=π/8\omega_x=\pi/8, the three-pass magnitudes of Lanczos3 and Lanczos5 are approximately 0.5100.510 and 0.5000.500, respectively. At ωx=3π/8\omega_x=3\pi/8, well inside the stopband, they fall to approximately 0.00470.0047 and 0.00240.0024. Lanczos5 has a steeper transition and a cleaner stopband.

The criterion therefore remains the same: the darker the area outside the square, the less energy can fold back into the baseband after decimation.

Limitations of CrossBox

The kernel determines how much each frequency is attenuated, but what actually enters the decimation step is h^(ω)f^(ω)\widehat h(\boldsymbol\omega)\widehat f(\boldsymbol\omega). Therefore, even with the same kernel, different source signals produce different degrees of aliasing because their frequency-energy distributions differ.

The three columns below use exactly the same FFT, logarithmic brightness range, and Nyquist square for 8×8\times downsampling. Each column shows the original image above its corresponding magnitude spectrum ∣f^∣|\widehat f|.

Original sinc signal with coordinate axes and a gridSpectrum of the sinc signal with coordinate axes and a grid, marking the Nyquist region for 8x downsampling
Original sinc signal with a diagonal gridSpectrum of the sinc signal with a diagonal grid, marking the Nyquist region for 8x downsampling
Original screenshot of the replacement app-folder interfaceSpectrum of the replacement app-folder interface screenshot, marking the Nyquist region for 8x downsampling
Spectrum of the sinc signal with coordinate axes and a grid after three-pass CrossBox filtering
Spectrum of the sinc signal with a diagonal grid after three-pass CrossBox filtering
Spectrum of the replacement app-folder interface after three-pass CrossBox filtering

Coordinate-axis and grid signal

Diagonal-grid signal

Replacement UI screenshot

CrossBox's directionality does not mean "stronger attenuation in the horizontal and vertical directions." Along a frequency axis, for example ωy=0\omega_y=0, the additional factor is cos⁡2(ωx/2)\cos^2(\omega_x/2); along the diagonal ωx=ωy\omega_x=\omega_y, it is cos⁡ωx\cos\omega_x. The latter falls faster near low frequencies and reaches zero earlier, at ωx=π/2\omega_x=\pi/2. Its attenuation is therefore generally stronger for diagonal frequencies and relatively weaker for components along the frequency axes. Actual flickering still depends on both this directional response and the input spectrum; we cannot conclude that CrossBox is more suitable merely because "UI imagery is dominated by horizontal and vertical edges."

Conclusion

  1. All four CrossBox shader taps in this implementation use bilinear sampling. Its actual single-pass discrete kernel is 4×44\times4, and its three-pass effective support is 22×2222\times22.
  2. Compared with three-pass Box2x2, CrossBox trades additional passband attenuation for stronger stopband suppression. Its response is also directional: attenuation is stronger for diagonal frequencies and relatively weaker along the frequency axes.
  3. Lanczos provides the best frequency selectivity, but its kernels are larger. Whether it is worthwhile depends on the target radius, bandwidth, and texture-sampling instruction cost.