Caesium Image Compressor Wrapper For Python
Project description
Caesium Image Compressor
A Python package for programmatically compressing images using the Caesium CLI.
Installation
pip install caesium_image_compressor
Optional Download
This step might be required if the Caesium CLI is not downloaded on pip install.
python -m caesium.downloader
Usage
from caesium import compress_image
# Compress an image
compress_image('path/to/image.jpg')
# Compress an image and save it to a different location
compress_image('path/to/image.jpg', 'path/to/compressed_image.jpg')
# Compress an image with a specific quality
compress_image('path/to/image.jpg', quality=50)
# Compress an image and drop the metadata
compress_image('path/to/image.jpg', exif=False)
# Compress an image and keep lossless
compress_image('path/to/image.jpg', lossless=True)
# Compress an image and show verbose logging
compress_image('path/to/image.jpg', verbose=True)
Defaults
def compress_image(
image_path: str,
output_path: str = None,
quality: int = 75,
exif: bool = True,
lossless: bool = False,
verbose: bool = False,
) -> None:
...
License
Apache 2.0
Author
TODO
Return the compressed image as:
- cv2 image
- PIL Image
- numpy array
- base64 string
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
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 caesium_image_compressor-0.19.3.tar.gz.
File metadata
- Download URL: caesium_image_compressor-0.19.3.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51e75603f53e4307e0bbe85445dc780e6c9514578c7bca6e4df9dab954494717
|
|
| MD5 |
976e408ad802560763fc7a80ffdd6e61
|
|
| BLAKE2b-256 |
a896b08273ba5a75afde43e28e1219880e227919253d80480c0f69ddc85f370b
|
File details
Details for the file caesium_image_compressor-0.19.3-py3-none-any.whl.
File metadata
- Download URL: caesium_image_compressor-0.19.3-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d976d68d487c418dd93fb3c2e56e93fd3e313f59f0013c41996fd6ac4a460d7e
|
|
| MD5 |
060b2cb7ee92196af3a93563b30c566e
|
|
| BLAKE2b-256 |
fdc358a7aa081e63ca2aa22b3bc607c8f57254294cb775d1af62686a1c5e943b
|