Skip to main content

Python package which contains 4 basic image processing functions.

Project description

imghelp

codecov

ci-cd

imghelp is a simple Python package to help users crop, rotate, compress, or change the color scale of a given image. It contains four functions: Crop(), ImgRotate(), ColorConv() and ImgCompress() and is designed to be a beginner-friendly image processing tool.

Installation

Install using pip:

$ pip install imghelp

Install using git bash directly from GitHub repo:

$ pip install git+git://github.com/UBC-MDS/imghelp.git

Or download directly from PyPI.

Usage

# import functions from imghelp 
from imghelp.crop import Crop
from imghelp.imgrotate import ImgRotate
from imghelp.colorconv import ColorConv
from imghelp.imgcompress import ImgCompress

Features

  • Crop(img, width, height) This function takes an image and the desired height/width as input, and returns a cropped image. The image size is cropped by removing the edge pixels until the input size is reached.

  • ImgRotate(img, degree) This function rotates an image either 90, 180, 270, or 360 degrees from it's original orientation. The image is rotated by pivoting the array of pixels by the desired degree.

  • ColorConv(img, color) This function converts an image to a color specified by user-input. The image is converted by changing the pixel values of the image's array.

  • ImgCompress(img, method, level=1) This function compresses an image to a user-defined compression level. The compression methods supported by this function are single value decomposition (SVD) and simple image resize. Additionally, users can select the compression levels desired (highest compression level = 1, lowest compression level = 2).

A more in-depth look at the features can be seen at https://imghelp.readthedocs.io/en/latest/

Python Ecosystem

There are many image processing libraries already present in the Python ecosystem. A few examples are:

  • OpenCV: Open source computer vision library, specifically the ImgProc module. ImgProc covers a large range of image processing, from image inversion to perspective warping.
  • Pillow: Open source library forked from the now defunct Python Imaging Library (PIL). In addition to extensive functions that can merge, enhance, and transform images, Pillow is unique in that it supports many image file formats.
  • Numpy: Python package oriented around extensive mathematical functions, as well as vectorizing matrices and arrays. Images can be read into a ndarray, which forms the basis for most image processing libraries, including the aforementioned OpenCV.

The aim for imghelp is not to replace the above packages. OpenCV, Pillow are packages geared towards pre-processing images for more complex tasks down the line, such as data analysis or machine learning, and can often have a steep learning curve. The intention for imghelp is to be a beginner-friendly Python library for basic image manipulation. A simple tool to use when all you need to do is rotate, crop, compress, or convert the colors of an image.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Contributors

The following people contributed to the creation of imghelp:

License

imghelp was created by Sufang Tan, Jasmine Ortega, Ho Kwan Lio, Maeve Shi. It is licensed under the terms of the MIT license.

Credits

imghelp was created with cookiecutter and the py-pkgs-cookiecutter template.

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

imghelp-1.0.10.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

imghelp-1.0.10-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file imghelp-1.0.10.tar.gz.

File metadata

  • Download URL: imghelp-1.0.10.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for imghelp-1.0.10.tar.gz
Algorithm Hash digest
SHA256 85de52fb3f7491f873131e69ed284d695a7e6f570f4fd0bb25a570590db3df76
MD5 7db4f9c1de5e7b07820314d57233d6bc
BLAKE2b-256 475b6b135abfd6a8c140264453af7091ac6071153e0d790980215f03c208eee3

See more details on using hashes here.

File details

Details for the file imghelp-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: imghelp-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for imghelp-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 87ca3c1940e1d98741bd023e964d8b45c6cf034996aa866b0686bef0ef4f31fe
MD5 1095f884f3f440ab212b9baebf7c1b82
BLAKE2b-256 5f0e74649b4bac136f11f12c0bb0da3305a0a8dc5af2de41e46689434f3649bf

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