mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
12 lines
292 B
Python
12 lines
292 B
Python
import PIL
|
|
from PIL import Image
|
|
from tkinter.filedialog import *
|
|
|
|
file_path=askopenfilenames()
|
|
img = PIL.Image.open(file_path)
|
|
myHeight,myWidth = img.size
|
|
|
|
img=img.resize((myHeight,myWidth),Image.Resampling.LANCZOS)
|
|
save_path=asksaveasfile()
|
|
|
|
img.save(save_path+"_compressed.JPG") |