• sensors in Digital Camera is discrete and in a grid as shown above
  • the world around us is continuous
  • digital images are discrete samples of the real world
  • every digital image begins with a sampling process that converts the continuous visual world into discrete pixels

  • the above image shows the results of image sampling and quantization
  • if we have smaller sampling intervals, we will have samples leading to a higher spatial resolution

Image Resolution

Sampling Frequency

  • sampling frequency describes how densly the image is sampled
  • high sampling frequency preserves more image details with less aliasing

Aliasing

Aliasing occurs when the sampling frequency is lower than the signal frequency.

Nyquist Sampling Theorem

To reconstruct a signal correctly (from digital back to contiuous), the sampling frequency must be at least twice its highest frequency.

Anti-Aliasing

Sampling Pipeline

graph TD
A[Continuous Image] --> B[Low Pass Filter used to remove High frequencies] --> C[Sampling] --> D[Digital Image]

Image Interpolation

Interpolation estimates unknown pixels using existing neighbouring pixels.

MethodNeighborhood SizeVisual QualityComputational SpeedCommon Artifacts
Nearest Neighbor (1 pixel)LowestFastestBlocky, jagged edges (pixelation)
Bilinear (4 pixels)ModerateFastSlight blurriness / soft edges
Bicubic (16 pixels)HighModerateMinor haloing
Lanczos or (36 to 64 pixels)HighestSlowestSlight ringing near sharp contrast edges

Nearest Neighbor: Copies the value of the single closest pixel. It requires minimal computation but creates severe "staircase" or pixelated artifacts when upscaling.

Bilinear Interpolation: Calculates a weighted average of the closest neighboring pixels using linear interpolation in both horizontal and vertical directions. It eliminates blocky pixels but introduces a soft blur.

Bicubic Interpolation: Uses a grid ( surrounding pixels) fitted to cubic polynomials. It preserves sharper edges and smoother gradients than bilinear interpolation at the cost of higher processing time.

Lanczos Interpolation: Uses a sinc-based windowed filter over a larger neighborhood ( or ). It delivers the sharpest detail preservation and highest image fidelity, making it the preferred choice for high-quality image resizing.