Skip to main content

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

Brian Jemilo II

TODO

Return the compressed image as:

  • cv2 image
  • PIL Image
  • numpy array
  • base64 string

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

caesium_image_compressor-0.19.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caesium_image_compressor-0.19.3-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file caesium_image_compressor-0.19.3.tar.gz.

File metadata

File hashes

Hashes for caesium_image_compressor-0.19.3.tar.gz
Algorithm Hash digest
SHA256 51e75603f53e4307e0bbe85445dc780e6c9514578c7bca6e4df9dab954494717
MD5 976e408ad802560763fc7a80ffdd6e61
BLAKE2b-256 a896b08273ba5a75afde43e28e1219880e227919253d80480c0f69ddc85f370b

See more details on using hashes here.

File details

Details for the file caesium_image_compressor-0.19.3-py3-none-any.whl.

File metadata

File hashes

Hashes for caesium_image_compressor-0.19.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d976d68d487c418dd93fb3c2e56e93fd3e313f59f0013c41996fd6ac4a460d7e
MD5 060b2cb7ee92196af3a93563b30c566e
BLAKE2b-256 fdc358a7aa081e63ca2aa22b3bc607c8f57254294cb775d1af62686a1c5e943b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page