How can I save an image with PIL?

前端 未结 4 675
青春惊慌失措
青春惊慌失措 2020-11-28 04:09

I have just done some image processing using the Python image library (PIL) using a post I found earlier to perform fourier transforms of images and I can\'t get the save fu

4条回答
  •  一生所求
    2020-11-28 04:46

    I know that this is old, but I've found that (while using Pillow) opening the file by using open(fp, 'w') and then saving the file will work. E.g:

    with open(fp, 'w') as f:
        result.save(f)
    

    fp being the file path, of course.

提交回复
热议问题