title: Fourier Transform in Python giving blank images
body: <p>I am new to python and I am simply trying the 2d Fourier transform on an image and simply reconstruct it using ifft2 in numpy. However, the spectrum magnitude and the reconstructed are white images. This might indicate some scaling issue but I don't understand how to resolve it.<a href="https://i.stack.imgur.com/urHhk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/urHhk.png" alt="enter image description here"></a></p>
  
  <pre><code>import matplotlib.image as mpimg
  import matplotlib.pyplot as plt
  imgloc="C:\\Users\\AnacondaCodes\\cameraman.png"
  img=mpimg.imread(imgloc,0)
  import numpy as np
  f=np.fft.fft2(img)
  fshift=np.fft.fftshift(f)
  magnitude_spectrum=20*np.log(np.abs(fshift))
  f_ishift=np.fft.ifftshift(magnitude_spectrum)
  img_back=np.fft.ifft2(f_ishift)
  img_back=np.abs(img_back)
  plt.subplot(131),plt.imshow(img, cmap='gray')
  plt.title('input image'), plt.xticks([]),plt.yticks([])
  plt.subplot(132),plt.imshow(magnitude_spectrum, cmap='gray')
  plt.title('Magnitude Spectrum'), plt.xticks([]), plt.yticks([])
  plt.subplot(133), plt.imshow(img_back,cmap='gray')
  plt.title('reconstructed'), plt.xticks([]), plt.yticks([])`
  </code></pre>