Merge pull request #16 from priddhesh/master

ImageCompressor
This commit is contained in:
Advaita Saha 2022-10-01 12:52:48 +05:30 committed by GitHub
commit 7a91d8527e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,17 @@
**Image Compression using PIL Python library**
It is CLI based program used to compress the images using PIL library.
Fixes #3
**Built With**
*Python (PIL Library)*
**Prerequisites**
1. `pip install pillow`
2. `pip install argparse`
**Run project in CLI**
`python imageCompressor.py file-name`

View File

@ -0,0 +1,16 @@
from PIL import Image
from tkinter.filedialog import *
import argparse
def compressImage(filename):
img = Image.open(filename)
myHeight, myWidth = img.size
img = img.resize((myHeight,myWidth), Image.ANTIALIAS)
img.save("compressed-"+filename)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("img",type = str)
args = parser.parse_args()
compressImage(args.img)

View File

@ -0,0 +1 @@
Pillow==9.1.0