A Python version of Photoshop where users can do simple tasks of photo editing, such as croopping an image, rescaling an image, applying filters to an image, and much more.
Project description
Pythoshop
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.
Functions
-
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.
Python Ecosystem Integration
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.
Related Packages:
-
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.
Installation
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:
- Download the Anaconda Installer:
- Visit the Anaconda Download page
- Choose the installer for your operating system (Windows, macOS, or Linux).
- Select the version for Python 3.x.
- Run the Installer:
- Windows: Open the downloaded .exe file and follow the instructions. It's recommended to check the option to "Add Anaconda to my PATH environment variable" for easy use in the command prompt, but be aware this can interfere with other software.
- macOS or Linux: Open Terminal, navigate to the directory containing the downloaded script, and run it with bash Anaconda3-xxxxxx.sh, following the on-screen instructions.
- Verify Installation:
Open your command line interface (CLI) and type
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
Usage
To unleash the power of Pythoshop, follow the simple steps below:
- Load the functions from Pythoshop
from pythoshop import adjust_brightness, resize_image, transform_image, apply_filter
- Make sure you assign the images you need to transform in the form of NumPy arrays.
- Now, You can process your images, below is an example of one how you can change the brightness of your image:
Adjust Brightness
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.
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
Salva Umar, Jenny Lee, Ella Hein, Runtian (Rachel) Li
License
Pythoshop
was created by Salva Umar, Jenny Lee, Ella Hein, Rachel Li. It is licensed under the terms of the GNU GPLv3 license.
Credits
pythoshop
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pythoshop-3.2.22.tar.gz
.
File metadata
- Download URL: pythoshop-3.2.22.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f20d9efa757ecf4ecb7c53f0552912804d8b3f6affe794822fe3130b198a5104 |
|
MD5 | 76614886e5a1634e88a0c967e195436d |
|
BLAKE2b-256 | 503546dec94a472bd709231855fc65432c44adc1104d8373402ae6dab3a82dcc |
File details
Details for the file pythoshop-3.2.22-py3-none-any.whl
.
File metadata
- Download URL: pythoshop-3.2.22-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27f65e007473ea508ddb6f401a29ebedcc88b8db8013b428eda80940dfb5b1f3 |
|
MD5 | b525a86a4170a4818676e12484a9d995 |
|
BLAKE2b-256 | 27e8620c53d65f27dc8090a557bd8b85d1f88189ee823ec3e7010848db2bc858 |