A wrapper for resmush.it API
Project description
reSmush.it Image Optimizer Python package
Project Description
Python3 wrapper for resmush.it API to optimize image file size.
resmush.it Image Optimizer allows you to use free Image optimization based on reSmush.it API.
reSmush.it provides image size reduction based on several algorithms. The API accept JPG, PNG and GIF files up to 5MB.
Installation
-
Install using pip3:
$ pip3 install resmushit
Usage
import resmushit
# Save image to current directory
resmushit.from_path(image_path='image.png', quality=95)
# Save image to preferred directory
resmushit.from_path(image_path='image.png', quality=95, output_dir="output/")
# return image bytes
_bytes = resmushit.from_url(image_url="https://ps.w.org/resmushit-image-optimizer/assets/icon-128x128.png", quality=95, save=False)
Options
image_url (str): The url of image.
image_path (str): The path of image
quality (int): Quality at which image is going to be optimized.
output_dir (str): Location for output image.
preserve_exif (bool): Preserve EXIF data in the file after optimization.
preserve_filename (bool): Optimized image will prefix 'optimized-' before image name.
quiet_mode (bool): Run in quiet mode when True
save (bool): When True, saves image in directory.
When False, returns bytes of 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
resmushit-1.0.1.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for resmushit-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c6d2d21a934c961a1026068196cbe81a249d74261b56176b0517a880d250e52 |
|
MD5 | 76bdd4aea15014a7abcd8be3e9d76c60 |
|
BLAKE2b-256 | d79f8f74889bc66c9d498f4412fec2aeac0120fbb6d08b997aa5bee5b811c630 |