# What should be the dimensions of a Fourier Transformed image?

I have applied Fourier Transform to the following image.

I have downloaded this image from the Internet. I re-sized (without maintaining the aspect ratio) it using MS Paint application of Win7 to make it 512x256.

Then I have used two applications to observe its Fourier Transformed appearance.

IPLab gives the following output:

ImageJ2-20160205 gives the following output:

As you can see, the first output is a 512x256 image. The second one is a 512x512 image.

Why are those outputs different?

How would they effect processing of an image?

• Without seeing the details of the transform, I would assume the second case is zero-padded out to the 512 dimension. If this is the case, this will result in interpolated samples to the original image when you do the IFFT; so a form of upsampling. Have you tried to take the IFFT of the second image using IPLab? – Dan Boschen Jul 14 '16 at 12:25
• @dan boschen, not yet. But, now I would. – user18425 Jul 14 '16 at 13:10
• @laurent duval, hmm.. What does that indicate? – user18425 Jul 14 '16 at 13:38
• That this is is not the size that only matters:) You have coloured images. Try redo on their grayscale version – Laurent Duval Jul 14 '16 at 13:43

public void run(ImageProcessor ip) {
boolean inverse;
if (!powerOf2Size(ip)) {
IJ.error("A square, power of two size image or selection\n(128x128, 256x256, etc.) is required.");
return;
}
ImageProcessor fht  = (ImageProcessor)imp.getProperty("FHT");
if (fht!=null) {
ip = fht;
inverse = true;
} else
inverse = false;
ImageProcessor ip2 = ip.crop();
if (!(ip2 instanceof FloatProcessor)) {
ImagePlus imp2 = new ImagePlus("", ip2);
new ImageConverter(imp2).convertToGray32();
ip2 = imp2.getProcessor();
}
fft(ip2, inverse);
}


which suggests that some parts of the code expect a) the image size to be a power of 2 and b) that the image is square. Perhaps some part of the code you are using is enforcing this?

Here is a third different output. So I have tried to perform an FFT with Matlab, on four versions of your image:

• the grayscale version of the colored image,
• the red, green, and blue channels.

I do get the following, with $512\times256$ size, in a $\log$ scale.

If as suggested by @Peter K. you zero-pad below, with $512\times512$ size, one gets:

Looks like the FFT of the Red component, padded. If you have the opportunity to do other tests, we can settle this riddle