Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from PIL import Image
- n = 1
- a = os.listdir("/home/chip/comp")
- for i in a:
- if i != 'compress.py':
- img = Image.open(i)
- x = img.size[0]
- y = img.size[1]
- compress = img.resize((x,y),Image.BILINEAR)
- compress.save(str(n) + '.jpg')
- n+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement