Pythoshop is a Python package designed to provide a set of handy image processing functions for simple yet effective adjustments to images. Whether you need to tweak brightness, adjust aspect ratios, transform images, or apply filters, Pythoshop has you covered.
adjust_brightness(image, brightness_factor, verbose):
Adjusts the brightness of an image object in the form of a NumPy array. The brightness_factor
parameter allows fine-tuning the brightness level. Returns an updated NumPy array.
resize_image(image, height, width, method:, verbose): This function takes a Numpy array image object and adjusts the image to have the inputted dimensions using the selected method. Returns an updated NumPy array.
transform_image(image, method, direction, verbose): Transforms a NumPy array image object based on the specified method and direction. Options include "rotate" or "flip", allowing users to orient images as needed. Returns an updated NumPy array.
apply_filter(image, method, degree, verbose): Applies a filter to an image object in the form of a NumPy array. Users can choose from filter methods and adjust the degree of filtering to achieve the desired visual effect. Returns an updated NumPy array.
Pythoshop complements existing image processing libraries in the Python ecosystem, offering a lightweight solution for common image adjustments. While other comprehensive libraries like Pillow and OpenCV provide extensive functionalities, Pythoshop focuses on simplicity and ease of use. If you need quick and straightforward image processing without the overhead of more extensive libraries, Pythoshop is the ideal choice.
Pillow: A powerful image processing library in Python, providing comprehensive features for image manipulation and editing.
OpenCV: An open-source computer vision and machine learning library, suitable for complex image processing tasks and computer vision applications.
This package is currently under development. Hence the installation instructions are as below. First, you need to make sure you have installed conda and poetry.
To install Anaconda:
conda list
. If Anaconda is installed properly, you should see a list of installed packages.To install poetry
, follow the instructions below:
We recommend installing Poetry
using their official installer while referring to their official poetry documentation for detailed installation instructions and support. (You will be installing poetry in your base environment, make sure to add poetry to system path on windows)
Now navigate to the folder where you want to download the pythoshop package.
# 1. clone the repo
$ git clone git@github.com:UBC-MDS/Pythoshop.git
# 2. create virtual environment
$ conda create --name pythoshop python=3.9 -y
$ conda activate pythoshop
# 3. install the package at the command line from the root package directory:
$ poetry install
In the future Once this package is published on PyPi, the package will be available for installation via:
pip install pythoshop
To unleash the power of Pythoshop, follow the simple steps below:
from pythoshop import adjust_brightness, resize_image, transform_image, apply_filter
from pythoshop import adjust_brightness, resize_image, transform_image, apply_filter
import matplotlib.image as mpimg
# Replace the path with the actual path you are saving your image
image = mpimg.imread('path/to/input_image.jpg')
brightness_factor = 20 # Adjust as needed
adjust_brightness.adjust_brightness(image, brightness_factor)
For further details on how you can use the other 3 functions, please refer to the docs linked here.
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.
Salva Umar, Jenny Lee, Ella Hein, Runtian (Rachel) Li
Pythoshop
was created by Salva Umar, Jenny Lee, Ella Hein, Rachel Li. It is licensed under the terms of the GNU GPLv3 license.
pythoshop
was created with cookiecutter
and the py-pkgs-cookiecutter
template.