Awesome-Python-Scripts/Image_Compressor/Image_Compressor.py
Prathima Kadari 657ce07b97
Added Image Compressor Script (#211)
* Added Readme.md

Gave a description of the project

* Added Image_Compressor 

Added image compressor script and a sample image to compress the image file to a reduced size.

* Updated README.md

Added my name in Contributors list.
2021-06-02 18:18:12 +05:30

12 lines
286 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),PIL.Image.ANTILIAS)
save_path=asksaveasfile()
img.save(save_path+"_compressed.JPG")