mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
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.
This commit is contained in:
parent
26a24c2891
commit
657ce07b97
BIN
Image_Compressor/Image.jpg
Normal file
BIN
Image_Compressor/Image.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
12
Image_Compressor/Image_Compressor.py
Normal file
12
Image_Compressor/Image_Compressor.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
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")
|
11
Image_Compressor/README.md
Normal file
11
Image_Compressor/README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Image_Compressor
|
||||
|
||||
This script compresses the image choosen to much reduced size. Image can be of any format.
|
||||
Note : The image should be in same folder as the script
|
||||
It will return with the compressed image when you compile.
|
||||
It automates the task of compressing the image in day to day lives.
|
||||
|
||||
# Dependencies:
|
||||
|
||||
pip install image
|
||||
|
|
@ -173,6 +173,7 @@ So far, the following projects have been integrated to this repo:
|
|||
|[Translate CLI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TranslateCLI)|[Rodrigo Oliveira](https://github.com/rodrigocam)|
|
||||
|[Rock-Paper-Scissor Game](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Rock-Paper-Scissor)|[Punit Sakre](https://github.com/punitsakre23)|
|
||||
|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)|
|
||||
|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)|
|
||||
|
||||
|
||||
## How to use :
|
||||
|
|
Loading…
Reference in New Issue
Block a user