Skip to main content

Compress & Optimize Images

Project description

ImgOpt - Compress & Optimize Images

ImgOpt is a simple and very easy to use package to Compress and Optimize images.

Features:

  • Easy to Use
  • Standalone Package
  • Image Compression Options
  • No Need to use External APIs
  • No Need for Any API Key

Installation

Pip Command

pip install imgopt

How to use?

Import imgopt Package

import imgopt

InBuilt Functions:

OptmizeImage Fuction:

This function will compress and optimize the input image and return the output as an image. You can select your desired filename in the second parameter.

imgopt.OptmizeImage(image_path,output_path_with_extension)
imgopt.OptmizeImage('pro.jpg','vinay.jpg')

If you don't pass any output filename, it will automatically generate a random filename with an extension.

imgopt.OptmizeImage('pro.jpg')

DynamicCompress Fuction:

This function will compress and optimize the input image. It requires one more parameter, representing the percentage of compression. The function will return the output as an image. You can select your desired filename in the second parameter. All three parameters are mandatory when using this function.

imgopt.OptmizeImage(image_path,output_path_with_extension,compress_percent)

The value of Compress Percent must be between 10 and 100 (Type: int). A lower percentage will reduce the file size more.

imgopt.OptmizeImage('pro.jpg','vinay.jpg',75)

Note: Default Compress Percent is set to 80


Code Examples

import imgopt

imgopt.OptmizeImage('pro.jpg')

imgopt.DynamicCompress('pro.jpg', 'hello.jpg',20)

Support This Project

paypal

coffee

Author

The ImgOpt Package is created by Vinay Chaudhary. This Project is Powered by Regem Enterprises

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

imgopt-0.3.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

imgopt-0.3-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file imgopt-0.3.tar.gz.

File metadata

  • Download URL: imgopt-0.3.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for imgopt-0.3.tar.gz
Algorithm Hash digest
SHA256 570f714691b061f57ce34ed8e138d132e8e9fc747a03fc7e57f52d01e1d7b763
MD5 8f8317325d569d6b23cd88c83bae435d
BLAKE2b-256 dc06a1ef62d36bfa5bb757f0f28c398d54dc0b7bda45a755adac4703dea52653

See more details on using hashes here.

File details

Details for the file imgopt-0.3-py3-none-any.whl.

File metadata

  • Download URL: imgopt-0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for imgopt-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7fc4bc46bcbaaa8411190e05ae7f06a639951609ef30a1376ac3a6c8bfaf7e8b
MD5 aa2421391a4b93f944fc713936a9e9ae
BLAKE2b-256 5a2b865e71de38a3d4202acd23231d1d7d5a8bb947660f858e7ba576c4e47875

See more details on using hashes here.

Supported by

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