Python Resize Pixel
Project description
resizePixel
change quality of the image
Package
Basic structure of package is
.
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── resizePixel
│ ├── __init__.py
│ ├── resizePixel.py
│ └── version.py
├── script
│ └── test
├── setup.py
└── tests
├── __init__.py
├── __pycache__
│ └── __init__.cpython-39.pyc
├── img
│ └── test.png
└── unit
├── __init__.py
├── test_resizePixel.py
└── test_version.py
Requirements
Package requirements are handled using pip. To install them do
pip install -r requirements.txt
Tests
Start the tests
Usage
# import library
from resizePixel.resizePixel import rpImage,reduce_qualtiy
from PIL import Image
import os
# image path
image_path = r"C:\Users\mkshgh\Downloads\img.png"
# I am saving in the same directory
# img_path,img_name > C:\Users\mkshgh\Downloads, img.png
img_path,img_name = os.path.split(image_path)
output_img_name = 'output_'+img_name
# open the image and check the current quality
image_file = Image.open(image_path)
my_image = rpImage(image_path,image_file)
info = my_image.get_image_meta()
print(info)
# decrease quality explained above
# Use quality from 1 to 99; 99 being the best and 1 being the worst quality
# If the quality of the image is already low use 1 to 20; works great with larger files.
new_image = reduce_qualtiy(output_img_name,image_file,quality=50,outputdir=img_path)
print(new_image)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
resizePixel-1.0.0.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file resizePixel-1.0.0.tar.gz.
File metadata
- Download URL: resizePixel-1.0.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fc8d32fff83b9dac81e5f50aabf5d0bce5ef714602dac986b2ba1a2c8d34393
|
|
| MD5 |
9cdb8e34aad73eda5b42e6280bd28bae
|
|
| BLAKE2b-256 |
ef82f501031d069dcc41cc13b2170ef808e85627222fd124fb7dbe24c27e5ec4
|
File details
Details for the file resizePixel-1.0.0-py3-none-any.whl.
File metadata
- Download URL: resizePixel-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
786338b67547e4471ea41ed4a71c0f6d3e8874c0477a3936932750bbb5be4e74
|
|
| MD5 |
f2e0ada361a0afa3ed8dd379fbad924a
|
|
| BLAKE2b-256 |
8c94af0d2c0be5a23b1a8fcd689071f16544ec618744d47de5cd09f77e39b97c
|