from PIL import Image
im = Image.open("9-6.jpg")
im.show()
im.save("test.png")
堆栈跟踪:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 1477, in save
save_handler(self, fp, filename)
File "/usr/lib64/python2.7/site-packages/PIL/PngImagePlugin.py", line 608, in _save
ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)])
File "/usr/lib64/python2.7/site-packages/PIL/ImageFile.py", line 456, in _save
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 395, in _getencoder
return encoder(mode, *args + extra)
TypeError: function takes at most 4 arguments (6 given)