Problem with Fourier and InverseFourier function

I have the following code

Image[img, ImageSize -> 300]
data = ImageData[img];
fdct = Fourier[data]
tdata = InverseFourier[fdct];
Image[tdata]


but it seems to fail when doing the inverseFourier function. The error I get is:

Image::imgarray: The specified argument {{{1. -2.0236*10^-17 I,1. -9.36654*10^-17 I,1. -3.45228*10^-17 I},<<49>>,<<330>>},{<<1>>},<<47>>,{{1. +4.61893*10^-17 I,<<19>> +<<24>> I,1. +7.44929*10^-17 I},<<49>>,<<330>>},<<330>>} should be an array of rank 2 or 3 with machine-sized numbers. >>


I'm actually not sure what I'm doing wrong as I've checked the "discrete fourier transforms" (http://reference.wolfram.com/mathematica/tutorial/FourierTransforms.html) and the output of fourier was just used in the inverseFourier to get the inverse...

Any ideas what is wrong here?

• Seems like you're right... Chopping values of solved the issue. – markovuksanovic Jul 27 '13 at 7:26

tdata acquired small imaginary parts. Try
Image[Chop@tdata]