001 / 28
What Is the Difference Between Nearest-Neighbor, Bilinear, Bicubic, and Lanczos Image Resizing?
Export a 24-megapixel camera raw file (6000 × 4000 pixels) down to a 1080 × 1350 social frame or upscale a retro game sprite, and your image editor asks you to pick a resampling filter: Nearest-Neighbor, Bilinear, Bicubic, or Lanczos. Why does one setting leave diagonal lines jagged, another make eyelashes look muddy, and a third keep fine fabric texture crisp? As explained in digital signal processing references on two-dimensional image scaling, bicubic spline convolution, and Lanczos windowed-sinc resampling, every resizing algorithm is a 2D reconstruction kernel defined by how many neighboring pixels it samples (1×1 up to 6×6) and whether its mathematical curve includes negative side lobes to preserve edge contrast.
From 1 Pixel to 16 Pixels: Nearest-Neighbor (1×1), Bilinear (2×2), and Bicubic (4×4)
When an image is scaled to a new pixel grid, output pixel centers rarely land squarely on input pixel centers. To calculate the RGB value at fractional coordinate (x, y), the resampler applies a 1D kernel horizontally and vertically across a square neighborhood of surrounding input pixels:
- Nearest-Neighbor Interpolation (
1×1 = 1 Pixel, Box Filter): Instead of blending colors, Nearest-Neighbor simply copies the single closest input pixel. For pixel art, QR codes, and UI screenshots scaled by exact integer multiples (200%,300%,400%), Nearest-Neighbor is unbeatable because it introduces zero anti-aliasing blur. On continuous-tone photographs or non-integer ratios, however, it produces severe staircase "jaggies" and moiré aliasing. - Bilinear Interpolation (
2×2 = 4 Pixels, Tent Filter): Computes a linear distance-weighted average of the 4 nearest pixels (2×2grid). Because all weights are strictly positive and slope linearly to zero, Bilinear is fast enough for real-time GPU texture mapping, but acts as a heavy low-pass blur filter when downscaling high-resolution photography. - Bicubic Interpolation (
4×4 = 16 Pixels, Cubic Polynomial Family): Evaluates a4×4grid of 16 surrounding pixels using third-degree piecewise cubic polynomials. Crucially, "Bicubic" is not a single curve—as formalized by Don Mitchell and Arun Netravali (1988), two parameters(b, c)tune the cubic filter between three famous presets:- Bicubic B-Spline (
b = 1, c = 0— "Bicubic Smoother"): Uses 100% positive weights across all 16 pixels, suppressing noise and eliminating halo artifacts at the cost of softer edges. - Mitchell-Netravali (
b = 1/3, c = 1/3— Balanced Standard): The mathematical sweet spot between blurring and ringing used by many graphics pipelines. - Catmull-Rom Spline (
b = 0, c = 0.5— "Bicubic Sharper"): An exact interpolating cubic spline whose outer ring of pixels carries negative weights (around-0.0625), acting as a built-in micro-contrast sharpener during downscaling.
- Bicubic B-Spline (
"In signal processing, an ideal Nyquist low-pass filter is an infinite sinc(x) = sin(πx)/(πx) wave; Lanczos-3 truncates that infinite wave to a 6×6 grid of 36 pixels using a second sinc window, delivering the highest photographic sharpness."
Why Lanczos-3 (6×6 = 36 Pixels) Is the Gold Standard for Photographic Downscaling
By the Nyquist-Shannon sampling theorem, the theoretically perfect filter for reconstructing or band-limiting a discrete image without losing sharpness is the normalized sinc(x) = sin(πx) / (πx) function. Because a pure sinc wave ripples outward to infinity (causing severe Gibbs phenomenon "ringing" halos across an entire image), meteorologist Claude Duchon (1979) applied mathematician Cornelius Lanczos's sigma approximation: multiplying the primary sinc(x) wave by a single central lobe of a stretched sinc(x / a) window over -a < x < a (Lanczos resampling):
- Lanczos-2 (
a = 2,4×4 = 16 Pixels): Clips the kernel at the second zero-crossing (one positive central lobe plus one negative side lobe on each side), keeping ringing below1%. - Lanczos-3 (
a = 3,6×6 = 36 Pixels): Evaluates 36 neighboring pixels (6×6footprint) with a central positive lobe, a negative first ring, and a small positive outer ring. As computer graphics pioneer Jim Blinn noted, Lanczos-3 preserves low-frequency tonal structure and rejects high-frequency aliasing better than any other finite convolution filter—making it the default high-quality resampler in Pillow (Image.Resampling.LANCZOS), ImageMagick, and FFmpeg. Its only caveat is on synthetic line art or high-contrast white-on-black text, where the negative lobe can create a faint1-pixelbright or dark halo ("ringing").
| Resampling Algorithm | 2D Grid Size | Sampled Pixels | Mathematical Basis | Negative Lobes? | Ideal Photographic / Design Use Case |
|---|---|---|---|---|---|
| Nearest-Neighbor | 1 × 1 |
1 px | Box / Point filter | No | Pixel art, retro sprites & integer UI scaling |
| Bilinear | 2 × 2 |
4 px | Linear tent filter | No | Real-time GPU previews; too soft for final exports |
| Bicubic B-Spline | 4 × 4 |
16 px | Cubic (b=1, c=0) |
No | Upscaling noisy gradients without haloing |
| Mitchell-Netravali | 4 × 4 |
16 px | Cubic (b=1/3, c=1/3) |
Mild | Balanced general-purpose image scaling |
| Catmull-Rom Bicubic | 4 × 4 |
16 px | Cubic (b=0, c=0.5) |
Yes (1 ring) | Crisp downscaling ("Bicubic Sharper" behavior) |
Lanczos-3 (a = 3) |
6 × 6 |
36 px | sinc(x)·sinc(x/3) |
Yes (2 lobes) | Gold-standard downscaling for camera raw/JPEGs |
How to Resize and Pad Camera Photos Without Losing Edge Acutance
When preparing a batch of 24MP or 45MP camera exports for Instagram carousels (1080 × 1350) or web galleries, high-order resampling (Lanczos-3 or sharp Bicubic) combined with clean aspect-ratio padding keeps fine eyelashes, foliage, and architectural lines crisp without double-scaling artifacts. Resize and pad high-resolution photos in BatchPad to export publication-ready frames locally on your device.