MATLAB: How to transform an gray scale image from frequency to spatial domain

fft2frequency to spatial domainifft2Image Processing Toolbox

I can transform a gray scale image from spatial domain to frequency domain. But when i transform that image form frequency to spatial domain using ifft() its not giving me the real image. What should i do?
Here is my code:
img = imread('sample.tif');
imgFFT = fft2(double(img));
img2 = ifft2(imgFFT);
I just want to simply transform an image to frequency domain and then re-transform it into original image. But that ifft2() function is not giving me the original image.

Best Answer

Seems to work for me.
A = magic(10);
Af = fft2(A);
Ai = ifft2(Af);
norm(A - Ai)
ans =
3.3779e-14