Skip to main content

VisuMorph

GitHub Release PyPI - Version GitHub Activity Project Status: Active – The project has reached a stable, usable state and is being actively developed. Documentation Status License: MIT Python 3.9.0+ codecov

VisuMorph is a powerful, user-friendly Python package designed for image manipulation. It simplifies image processing tasks, allowing users to effortlessly apply transformations and adjustments to their images. With its intuitive interface and a wide range of functionalities, VisuMorph is ideal for both hobbyists and professionals looking to enhance their digital imagery.

Documentation

The full documentation including installation guides, example usages, and API references is hosted on ReadTheDocs and can be found here:

https://visumorph.readthedocs.io/en/latest/

Contributors

In alphabetical order:

Installation

For Regular Users

Currently, the package is published on PyPI. If you're looking to use VisuMorph without diving into the development, you can easily install it using pip:

pip install visumorph

For Developers

For those interested in contributing or exploring the development version, please follow these steps:

  1. Clone the repository:

    git clone https://github.com/UBC-MDS/VisuMorph.git
    
  2. Navigate to the cloned directory and install the package in editable mode along with the development dependencies:

    pip install -e .
    

Features

VisuMorph includes a variety of functions for image manipulation:

  • Flipping(flip): Horizontally or vertically flip images, useful for creating mirror effects or correcting orientation.
  • Rotating(rotate): Rotate images by a specified degree, supporting both clockwise and anticlockwise rotations.
  • Hue Change(change_hue): Adjust the hue of images, allowing for color shifting and mood setting in visuals.
  • Scaling(scale): Resize images, either uniformly or non-uniformly, without losing the essence of the visual content.

Quick Start Examples

For a quick glimpse into what VisuMorph can do, here are a few simple examples:

Flip an Image

Flip an image horizontally or vertically. This example flips an image horizontally.

import visumorph as vm

# Load your image
img = vm.load_image("path/to/image.jpg")

# Flip the image horizontally
flipped_img = vm.flip(img, v=0)

# Save the flipped image
flipped_img.save("path/to/flipped_image.jpg")

Rotate an Image

Rotate an image by a specified angle in degrees. This example rotates an image by 90 degrees.

import visumorph as vm

# Load your image
img = vm.load_image("path/to/image.jpg")

# Rotate the image by 90 degrees
rotated_img = vm.rotate(img, rotation=90)

# Save the rotated image
rotated_img.save("path/to/rotated_image.jpg")

Change Image Hue

Change the hue of an image. This example changes the hue by a delta value.

import visumorph as vm

# Load your image
img = vm.load_image("path/to/image.jpg")

# Change the hue of the image
hue_changed_img = vm.change_hue(img, delta_hue=0.3)

# Save the hue-changed image
hue_changed_img.save("path/to/hue_changed_image.jpg")

Scale an Image

Scale an image by a specified factor. This example enlarges the image by 20%.

import visumorph as vm

# Load your image
img = vm.load_image("path/to/image.jpg")

# Scale the image by 1.2 times
scaled_img = vm.scale(img, scale=1.2)

# Save the scaled image
scaled_img.save("path/to/scaled_image.jpg")

Make sure to replace "path/to/image.jpg" and the save paths with the actual paths to your image files and desired output locations.

Running Tests

To ensure VisuMorph works as expected, we've included a suite of tests. You can run these tests using pytest to verify the installation and functionality:

pytest --cov=visumorph

If a coverage report is desired, you can run the above command with an extra arugment:

pytest --cov=visumorph --cov-report=xml

Position in the Python Ecosystem

VisuMorph, while a robust tool for image manipulation, is designed primarily as an educational project for the 524 course in the Master of Data Science program. It serves as an introductory tool for those beginning their journey in data science and image processing. While it offers a range of functionalities, it is more limited in scope compared to professional-grade packages like PIL (Python Imaging Library) and OpenCV. These larger libraries offer a wider range of complex functionalities and are suited for industrial applications. However, VisuMorph stands out for its simplicity and ease of use, making it an excellent starting point for students and hobbyists looking to understand the basics of image manipulation in Python.

For reference to more advanced libraries, you can visit:

  • PIL (Python Imaging Library): PIL
  • OpenCV: OpenCV

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.

License

visumorph was created by Orix Au Yeung, Marco Bravo, Atabak Alishiri, Shawn Hu. It is licensed under the terms of the MIT license.

Credits

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

Metadata

Release files for visumorph 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for visumorph 3.0.1
File Size Uploaded Provenance
visumorph-3.0.1.tar.gz 9.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for visumorph 3.0.1
File Interpreter ABI Platform
visumorph-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / visumorph-3.0.1.tar.gz

Download URL visumorph-3.0.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0da48719f259c002fbf7666618af1d372163178cce2cb5314f1fd852ee021b9b
BLAKE2b-256 checksum
How to use checksums
a8c4ad20a9ee50ccedd34beed5b386e4dc29bf9e626c09edd2ac6854de76d3e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / visumorph-3.0.1-py3-none-any.whl

Download URL visumorph-3.0.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a05708b502892e504e059e319f9966fc3c541ca607058c1007c8c8489717b167
BLAKE2b-256 checksum
How to use checksums
5d8fdf24a93c8821b3f601bb30228949416d2277b27b6b525d67c03c270a1aaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for visumorph 3.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page