Package: pythoshop
PythoshopPythoshop 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.Functionsadjust_brightness(image, brightness_factor, verbose):Adjusts the brightness of an image object in the form of a NumPy array. Thebrightness_factorparameter 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 IntegrationPythoshop 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.InstallationThis 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 theAnaconda Download pageChoose 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 typeconda list. If Anaconda is installed properly, you should see a list of installed packages.To installpoetry, follow the instructions below:We recommend installingPoetryusing their official installer while referring to their officialpoetry documentationfor 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$gitclonegit@github.com:UBC-MDS/Pythoshop.git# 2. create virtual environment$condacreate--namepythoshoppython=3.9-y
$condaactivatepythoshop# 3. install the package at the command line from the root package directory:$poetryinstallIn the future
Once this package is published on PyPi, the package will be available for installation via:pip install pythoshopUsageTo unleash the power of Pythoshop, follow the simple steps below:Load the functions from Pythoshopfrompythoshopimportadjust_brightness,resize_image,transform_image,apply_filterMake 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 Brightnessfrompythoshopimportadjust_brightness,resize_image,transform_image,apply_filterimportmatplotlib.imageasmpimg# Replace the path with the actual path you are saving your imageimage=mpimg.imread('path/to/input_image.jpg')brightness_factor=20# Adjust as neededadjust_brightness.adjust_brightness(image,brightness_factor)For further details on how you can use the other 3 functions, please refer to the docs linkedhere.ContributingInterested 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.ContributorsSalva Umar,
Jenny Lee,
Ella Hein,
Runtian (Rachel) LiLicensePythoshopwas created by Salva Umar, Jenny Lee, Ella Hein, Rachel Li. It is licensed under the terms of the GNU GPLv3 license.Creditspythoshopwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.