Bilinear filtering

from Wikipedia, the free encyclopedia

The bilinear filtering or bilinear interpolation is an extension of the linear interpolation for intermediate values within a two-dimensional rectangular grid to be determined. It is often used as a graphics filter for scaling raster graphics and for displaying textures in rendered images.

Mathematical description

Bilinear interpolation

It is assumed that the value of a function is to be determined at some point . This should still be surrounded by four fixed grid points and . In order to determine the value approximately (by linear interpolation), linear interpolation is first carried out in a specified direction (horizontal or vertical, here horizontal) between the grid points. Here and are support points between the grid points lying in the horizontal direction.

The same procedure is then used to interpolate between the values ​​of these two points.

If the grid points of the function are regular and given, the equation is reduced to

This equation can be summarized in matrix notation as follows.

An extension of this method by an additional third dimension is called trilinear interpolation.

Application in computer graphics

With bilinear filtering, the four colors closest to the sample center are linearly interpolated in each axis ( u and v ) . To do this, the two values ​​between the upper and lower texels are first linearly interpolated along the u- axis. These two values ​​are then linearly interpolated along the v -axis. This two-stage linear interpolation gives the bilinear interpolation its name. The shares are only dependent on the scanning position, not , however, the size of the projection of the pixel in texture space. In the case of a minification (the texture is strongly compressed) this leads to scanning errors because too few texels are taken into account, it has a smoothing effect on a maxification (the texture is greatly enlarged), since the same four neighboring texels are considered for each pixel, but weighted differently become. In clear terms, the texels are weighted more heavily, the center of which is closer to the sample center, whereby all four neighboring texels are always considered.

Bilinear filtering is of particular importance in real-time rendering on modern graphics cards . Here, the bilinear filtering is a common method for anti-aliasing of textures . In terms of circuitry, bilinear interpolators can be implemented comparatively easily using cascaded linear interpolators.

If the texture is scaled by point sampling , the texels would be recognized as small blocks, so that the result would be very "pixelated". This procedure took place in old computer games , the graphics of which were calculated purely by the CPU.

Graphics programs usually also offer bicubic filtering . This increases the computational effort considerably, but in many cases provides better quality.

Further filtering

Web links