There are two issues you want to consider when shifting images: you want to know if they will conserve flux and you want to know if they will preserve spatial information. Generally, we probably want to require flux conservation, and we want to preserve as much spatial information as necessary. You may also be interested in carrying along error information for each pixel values.
If you know the underlying shape, you can determine the value at every location. In reality, however, we sample or bin the underlying function. There is a clear distinction between sampling and binning. Binning becomes equivalent to sampling when your function in well approximated by a linear function across the pixel, but not if there is any curvature.
First let's consider functions which are sampled (not binned). For many imaging applications, there is a physical process (e.g., seeing) which limits the amount of high spatial frequency information. When it is the case that there is an upper frequency cutoff in the power spectrum of the objects being observed, it is possible to recover the full function from samples of it if the samples are sufficiently fine. This is known as the sampling theorem. It says that if you have a band-limited function, you can recover the function if you have samples at spacing not exceeding , where is the frequency at which the power spectrum goes to zero. For example, if you say seeing wipes out scales less than 0.2 arcsec, you need to sample at 0.1 arcsec to recover the full function.
In practice, we don't measure a frequency cutoff and we don't rigorously define critical sampling, but we talk about it anyway. Generally, in astronomy, critical sampling is sampling at at least twice the full-width- half-maximum of the seeing disk (or the size of the Airy disk for diffraction limited applications). Note that this definition is pretty loose considering we have square, not circular pixels. Probably something like three samples is more reasonable.
If you can recover the function, then you can sample it at different locations. You can do this using the sampling theorem by something known as sinc interpolation. This works by recovering the original function; the process is done by filtering by a box function in transform space, which is equivalent to convolution with a sinc function in real space.
However, even at ``critical'' sampling, the binned function is not equivalent to the sampled function. So in fact, sinc interpolation may not be accurate unless you are better than critically sampled. If you are undersampled, it fails miserably. Near critical sampling, it can lead to non-flux conserving interpolation, which you generally really want to avoid. So it is not preferred unless you are very well sampled.
Perhaps the simplest method of shifting is nearest pixel shifts, and in fact, it turns out to be one of the very best ways to shift. The concept is simple: determine the shift between images, round it to the nearest integer, shift your image by that amount trivially, and add the results. This obviously conserves flux, and preserves full error information. It also does a surprisingly good job of preserving spatial information.
More sophticated routines are not necessarily better. Generally, these schemes use some sort of polynomial interpolation, where a nth order polynomial that runs through the n+1 points surrounding the desired location is determined. This is often known as Lagrangian interpolation. For , this is just linear interpolation, or, in two dimensions, bilinear interpolation. In 2D, you can do bilinear interpolation one dimension at a time. The formula is just:
This can be extended to higher order. Often, bicubic is used. However, higher order doesn't necessarily buy you anything. One has to be very careful with higher order schemes, because in their simplest implementations, they do not conserve flux. It is straightforward to write higher order routines which fit binned functions and thus preserve flux, but many implementations you find will not do this.
In the case of very well sampled images, all of these routines do very well. As you get less well sampled, however, you need to be more careful. In fact, nearest pixel shifting does as well or better as more sophisticated routines, so I recommend it highly. Binned Lagrangian 4th order works very nicely, and I often use it.
Spline interpolation: guarantees continuity of derivatives.