mikecharles
10/5/2016 - 9:00 PM

Reduce the file size of an image in Python

Reduce the file size of an image in Python

from PIL import Image
im = Image.open(img_file)
im.convert('P', palette=Image.ADAPTIVE, colors=256).save(img_file)