Urgent: Extrapolate 2D image to give 3D effect

Hey,

I have been using libtiff library to read and write 2D tiff images. But right now I am just stacking up the images without distance between them. If I need to gice the distance between them, I will need to extrapolate the images to fill that distance. How can I extrapolate.