Offset image with border interpolation

Hello,

This url is searched out via google. I want to do it similarlly, i.e. offset an image with a dx and dy. I want also pixels moved away from the border should be interpolated with the old borders.