Reduce image size
Project description
Image Size Reducer
Image Size Reducer is a package created for reducing image size for fast uploading and processing.
Steps
- Specify image path
- Specify quality 1-100
- Specify path where you want to save
Installation
Image Size Reducer requires python3 to run.
pip install imageSizeReducer
Usage
Image Size Reducer
from imageSizeReducer import imageSizeReducer
actualImage = "path/to/img.jpg"
pathToSave = "path/to/img.jpg"
quality=95
imageSizeReducer.resize(actualImage, quality, pathToSave)
# output - {'message': 'successfully completed image resize', 'actual-image-path': '/home/bramhesh/Downloads/20.jpg', 'quality-specified': 50, 'path-to-image': '/home/bramhesh/20.jpg'}
# output - {'message': 'image resize process failed', 'error': FileNotFoundError(2, 'No such file or directory'), 'actual-image-path': '/home/bramhesh/Downloads/2.jpg', 'quality-specified': 50, 'path-to-image': '/home/bramhesh/20.jpg'}
# output - {'message': 'image resize process failed', 'error': ValueError('unknown file extension: '), 'actual-image-path': '/home/bramhesh/Downloads/20.jpg', 'quality-specified': '/home/bramhesh/20.jpg', 'path-to-image': 50}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
imageSizeReducer-0.2.1.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for imageSizeReducer-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8c9bba350108434c40eb3867dc0096b21bb65782c8ac194d6f0efe0deb10462 |
|
MD5 | 9c66996be9707419ebc3fdd26daef071 |
|
BLAKE2b-256 | c6181faa420edd9251d62a4f09c729aa44f379e4cf0579dab2361c23b963ea5c |