I just did some image processing using the Python Image Library (PIL), using the message I found earlier to perform Fourier transforms of images, and I can't get the save function to work. All the code works fine, but it just wonβt save the resulting image:
from PIL import Image import numpy as np i = Image.open("C:/Users/User/Desktop/mesh.bmp") i = i.convert("L") a = np.asarray(i) b = np.abs(np.fft.rfft2(a)) j = Image.fromarray(b) j.save("C:/Users/User/Desktop/mesh_trans",".bmp")
The error I am getting is the following:
save_handler = SAVE[string.upper(format)] # unknown format KeyError: '.BMP'
How to save image using Pythons PIL?
python save python-imaging-library
user1999274 Jan 22 '13 at 6:30 2013-01-22 06:30
source share