In mathematics, bicubic interpolation is an extension of cubic spline interpolation (a method of applying cubic interpolation to a data set) for interpolating data points on a two-dimensional regular grid.
The interpolated surface (meaning the kernel shape, not the image) is smoother than corresponding surfaces obtained by bilinear interpolation or nearest-neighbor interpolation.
Bicubic interpolation can be accomplished using either Lagrange polynomials, cubic splines, or cubic convolution algorithm.
In image processing, bicubic interpolation is often chosen over bilinear or nearest-neighbor interpolation in image resampling, when speed is not an issue.
In contrast to bilinear interpolation, which only takes 4 pixels (2×2) into account, bicubic interpolation considers 16 pixels (4×4).
Images resampled with bicubic interpolation can have different interpolation artifacts, depending on the b and c values chosen.
The interpolation problem consists of determining the 16 coefficients
mixed partial derivative: The expressions above have used the following identities:
Bicubic interpolation on an arbitrarily sized regular grid can then be accomplished by patching together such bicubic surfaces, ensuring that the derivatives match on the boundaries.
Inverting the matrix gives the more useful linear equation
There can be another concise matrix form for 16 coefficients:
Often, applications call for bicubic interpolation using data on a rectilinear grid, rather than the unit square.
In this case, the most practical approach to computing the coefficients
Next, the normalized interpolating variables are computed as
If the derivatives are unknown, they are typically approximated from the function values at points neighbouring the corners of the unit square, e.g. using finite differences.
, using that method, find the slope between the two surrounding points in the appropriate axis.
, take the derivative in both axes, one at a time.
At the edges of the dataset, when one is missing some of the surrounding points, the missing points can be approximated by a number of methods.
A simple and common method is to assume that the slope from the existing point to the target point continues without further change, and using this to calculate a hypothetical value for the missing point.
Bicubic spline interpolation requires the solution of the linear system described above for each grid cell.
An interpolator with similar properties can be obtained by applying a convolution with the following kernel in both dimensions:
This approach was proposed by Keys, who showed that
produces third-order convergence with respect to the sampling interval of the original function.
[1] If we use the matrix notation for the common case
, we can express the equation in a more friendly manner:
Note that for 1-dimensional cubic convolution interpolation 4 sample points are required.
The bicubic algorithm is frequently used for scaling images and video for display (see bitmap resampling).
It preserves fine detail better than the common bilinear algorithm.
However, due to the negative lobes on the kernel, it causes overshoot (haloing).
This can cause clipping, and is an artifact (see also ringing artifacts), but it increases acutance (apparent sharpness), and can be desirable.