Python: Remove Exif info from images

后端 未结 4 1873
天命终不由人
天命终不由人 2020-11-30 06:02

In order to reduce the size of images to be used in a website, I reduced the quality to 80-85%. This decreases the image size quite a bit, up to an extent.

To reduce

4条回答
  •  Happy的楠姐
    2020-11-30 06:52

    You don't even need to do the extra steps @user2141737 suggested. Just opening it up with PIL and saving it again seems to do the trick just fine:

    from PIL import Image
    image = Image.open('path/to/image')
    image.save('new/path/' + file_name)
    

提交回复
热议问题