I am taking a jpg image and using numpy\'s fft2 to create/save a new image. However it throws this error
\"IOError: cannot write mode F as JPEG\"
>
Semente's answer is right for color images For grayscale images you can use below:-
new_p = Image.fromarray(fft_p)
new_p = new_p.convert("L")
If you use new_p = new_p.convert('RGB') for a grayscale image then the image will still have 24 bit depth instead of 8 bit and would occupy thrice the size on hard disk and it wont be a true grayscale image.