from PIL import Image
img=Image.open('C:\\Users\\user\\Desktop\\image\\IMG_20200730_104524.jpg')
img.save("IMG_20200730_104524_compress.jpg", format="JPEG", quality=30)
import os
from PIL import Image
for i in os.listdir('C:\\Users\\user\\Desktop\\image'):
img=Image.open(i)
img.save(i, format="JPEG", quality=30)