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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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