Skip to main content

python-image-tools is a python package for working with images

Project description

python-image-tools

The python-image-tools is a python package that allows you to easily download an image from a given URL and manipulate it.

Installation

  • Run pip install python-image-tools

Usage

To use the class, you first need to import it:

from image_tools import ImageDownloader

img = ImageDownloader("https://www.example.com/image.jpg")

Download an Image

To download an image, you can use the download_image method:

img.download_image()

Resize an Image

To resize an image, you can use the resize_image method, passing in the desired width and height of the image:

img.resize_image(500, 500)

Resize an Image by Percent

To resize an image by a certain percent, you can use the resize_image_by_percent method, passing in the desired percent:

img.resize_image_by_percent(50)

Change Image format

To change image format, you can use the change_image_format method, passing in the desired format:

img.change_image_format("png")

Reduce Image size

To reduce image size, you can use the reduce_image_size method, passing in the desired size in kilobytes:

img.reduce_image_size(50)

Rename Image

To rename image, you can use the rename_image method, passing in the desired name:

img.rename_image('test')

Note

  • If you want to resize the image to a specific file size, you should first reduce the image file size to your desired file size and then change the image format to a format that supports compression such as JPEG.

  • The class will overwrite the original image file, so make sure to save a copy of the original image before using the class.

Support

If you have any issues or questions, please don't hesitate to reach out to us at amirhamiri74@gmail.com.

Project details


Release history Release notifications | RSS feed

This version

0.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-image-tools-0.4.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

python_image_tools-0.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file python-image-tools-0.4.tar.gz.

File metadata

  • Download URL: python-image-tools-0.4.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for python-image-tools-0.4.tar.gz
Algorithm Hash digest
SHA256 467d08389f56e19e6309e6a651a27165143b0dc525034e2b4ace7ea3381d4c7b
MD5 98ffd42129d96262326b6139d6473b1c
BLAKE2b-256 56d1fe6f8e2419693ead86ab5ff1f88383e43b720a506c7e2c1cbdd21a43b9fb

See more details on using hashes here.

File details

Details for the file python_image_tools-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for python_image_tools-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ffbb1024c079a39758bc40b173655bab08386ee96b2793dff17d2a8329d652
MD5 42fafbd68b0dc8c648070f2460444a05
BLAKE2b-256 c37a07ee815b5b1f84e44dd4ce6af158a608f5bb877167b71eaaf2bb4ca1dbf5

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