Bilinear interpolation is a method for estimating unknown values on a two-dimensional grid by taking a weighted average of the four nearest known values. It’s the standard technique used whenever software needs to “fill in the gaps” between data points on a flat surface, whether that’s resizing a digital photo, mapping a texture onto a 3D model, or estimating elevation between survey points on a terrain map.
The name breaks down simply: “bi” means it works in two directions (horizontal and vertical), and “linear” means it uses straight-line estimation in each direction. The result is smooth, fast, and good enough for the vast majority of everyday applications.
How It Works Step by Step
Imagine you have a grid of known values, like pixel colors in an image. You need the value at a point that falls between four grid cells. Bilinear interpolation finds that value in two stages. First, it performs linear interpolation horizontally, blending the top two neighbors into one intermediate value and the bottom two neighbors into another. Then it interpolates vertically between those two intermediate values to get the final result.
To make this concrete, picture a 2×2 block of pixels. Your target point sits somewhere inside that block. If it’s close to the top-left pixel, that pixel should have the most influence on the result. If it’s dead center, all four pixels should contribute equally. Bilinear interpolation handles this automatically through its weighting system.
Using a simplified coordinate system where the four known points sit at corners (0,0), (0,1), (1,0), and (1,1), the formula looks like this:
f(x,y) ≈ f(0,0)(1−x)(1−y) + f(0,1)(1−x)y + f(1,0)x(1−y) + f(1,1)xy
Each of those four terms is one known value multiplied by a weight. The weights are:
- Top-left: (1−x)(1−y)
- Top-right: (1−x) × y
- Bottom-left: x × (1−y)
- Bottom-right: x × y
Here, x and y are the fractional distances from the top-left corner to your target point, each ranging from 0 to 1. The four weights always sum to exactly 1, which guarantees the result stays within the range of the original values. If your target point lands exactly on one of the four corners, that corner gets a weight of 1 and the others get 0, so you just get the original value back.
Why It’s Called “Bilinear”
The result is linear along any row or column of the grid. If you hold y constant and slide x from 0 to 1, the output changes in a straight line. The same is true if you hold x constant and vary y. But if you move diagonally, the output follows a curve because of the x×y cross term in the formula. Mathematically, the full expression is a polynomial of the form A₀ + A₁x + A₂y + A₃xy. That cross term is what distinguishes bilinear interpolation from plain linear interpolation and gives it a subtle, smooth curvature across the 2D surface.
Where Bilinear Interpolation Gets Used
The most common application is image processing. Any time you resize a photo, rotate it, or warp its perspective, software needs to figure out what color each pixel should be in the new image. The new pixel positions rarely line up perfectly with the original grid, so interpolation fills in the gaps. Bilinear interpolation is the default method in most image editors and viewers because it produces smooth results without heavy computation.
In 3D graphics and video games, bilinear filtering is the standard way textures (2D images) get mapped onto 3D surfaces. When a texture is viewed at an angle or from a distance, the screen pixels don’t correspond one-to-one with texture pixels. The GPU samples the four nearest texture pixels and blends them. Modern graphics hardware has dedicated circuits for this operation, making the computational cost essentially negligible compared to nearest-neighbor sampling.
Geographic information systems (GIS) rely on bilinear interpolation when working with raster data like digital elevation models. If you need the estimated elevation at a point that falls between four surveyed grid cells, bilinear interpolation provides a reasonable estimate by blending those four neighboring elevation values. The same principle applies to weather maps, satellite imagery, and any gridded environmental dataset.
How It Compares to Other Methods
Bilinear interpolation sits in the middle of a speed-versus-quality spectrum. The two methods it’s most often compared against are nearest-neighbor and bicubic interpolation.
Nearest-neighbor interpolation is the simplest approach: it just picks the single closest known value. It’s extremely fast and preserves hard edges, which makes it useful for pixel art or categorical data (like land-use maps where you don’t want to average “forest” with “water”). The downside is obvious: results look blocky and jagged when you zoom in, because there’s no blending at all.
Bicubic interpolation uses a 4×4 neighborhood (16 surrounding points) instead of a 2×2 block. This produces smoother, sharper results, particularly for fine details and gradual gradients. In elevation model studies, bicubic resampling consistently outperforms bilinear, reducing error metrics significantly when downscaling terrain data. The trade-off is that it requires roughly four times as many calculations per output point.
Bilinear interpolation strikes a practical balance. It eliminates the blockiness of nearest-neighbor while staying much cheaper than bicubic. For most everyday tasks (viewing photos, playing games, quick map lookups), the visual difference between bilinear and bicubic is subtle enough that bilinear wins on efficiency.
Limitations and Artifacts
The main weakness of bilinear interpolation is blurring. Because it averages neighboring values, it softens sharp edges and fine details. If you upscale a small image to a much larger size, bilinear interpolation produces a smoother but noticeably fuzzy result compared to the original. The more you scale up, the more apparent this becomes.
Aliasing artifacts can also appear, particularly when downscaling images or sampling high-frequency patterns (like thin stripes or checkerboards). In these situations, the 2×2 sampling window is too small to capture enough information, and the output can show stair-stepping or moiré patterns. Sharpening filters or anti-aliasing passes are sometimes applied afterward to compensate.
Another practical consideration: when a transformation maps a target point outside the bounds of the original data, bilinear interpolation can’t work because there are no surrounding values to blend. Software typically handles this by assigning a default value (often zero or black in image processing) to those out-of-bounds locations, which can produce visible borders on rotated or warped images.
Choosing the Right Method
If you’re resizing images in a photo editor, rotating video frames, or working with continuous data in GIS, bilinear interpolation is a solid default. It’s fast, widely supported, and produces clean results for moderate transformations. Switch to bicubic if you need the sharpest possible output and don’t mind slower processing, such as preparing images for print or resampling high-resolution terrain data. Use nearest-neighbor when you’re working with categorical data, pixel art, or any situation where blending between values would be meaningless.
Most software gives you this choice explicitly. Photoshop, GIMP, GDAL, and game engines all let you select the interpolation method. In GPU-based rendering, bilinear filtering is typically the default texture sampling mode, with options to upgrade to trilinear or anisotropic filtering for better quality at oblique viewing angles.

