A python library for graphical image manipulation
Project description
pythonGraphicalManipulator
pythonGraphicalManipulator is a Python library designed for advanced image manipulation using pixel grids. It offers functions for resizing, cropping, color adjustments, and creative effects such as black-and-white conversion, color isolation, and brightness control. This library is ideal for developers working with custom image processing workflows.
Features
-
Image Manipulation
-
Resize and crop images.
-
Flip images horizontally or vertically.
-
-
Color Transformations
-
Convert images to black and white.
-
Isolate or remove specific colors.
-
Replace specific colors with new ones.
-
-
Adjustments
-
Brightness, shadow intensity, and black point adjustments.
-
Warmth and fade effects for aesthetic modifications.
-
-
I/O Operations
-
Convert images to pixel grids and vice versa.
-
Export pixel grids to text files for external processing.
-
Installation
Install the library using pip:
pip install pythonGraphicalManipulator
Quick Start
Here’s how to get started with pythonGraphicalManipulator:
1. Convert an image to a pixel grid:
from pythonGraphicalManipulator import imageToPixelGrid
pixelGrid = imageToPixelGrid("example.jpg")
2. Apply a transformation:
from pythonGraphicalManipulator import bnw
bnwGrid = bnw(pixelGrid)
3. Convert back to an image:
from pythonGraphicalManipulator import pixelGridToImage
pixelGridToImage(bnwGrid, "output.jpg")
Available Methods
Image Manipulation
-
imageToPixelGrid(imagePath, outputToTextFile=False, textFile=None) -
pixelGridToImage(pixelGrid, outputImagePath) -
resizeImage(pixelGrid, length, width) -
cropImage(pixelGrid, top, left, right, bottom) -
flipHoriz(pixelGrid) -
flipVert(pixelGrid)
Color Transformations
-
bnw(pixelGrid) -
singleColorPop(pixelGrid, r, g, b, threshold=50) -
singleColorRemove(pixelGrid, r, g, b, threshold=50) -
changeColor(pixelGrid, r1, g1, b1, r2, g2, b2, threshold=0)
Adjustments
-
adjustBrightness(pixelGrid, factor) -
adjustShadowIntensity(pixelGrid, factor) -
adjustBlackPoint(pixelGrid, level) -
adjustWarmth(pixelGrid, factor)
Tests
The tests folder includes unit tests to validate the functionality of the library. To run the tests:
python -m unittest discover tests
Contributing
Contributions are welcome! Please fork this repository and submit a pull request for any bug fixes or enhancements.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Developed by Dharyansh Achlas For any queries, feel free to contact https://github.com/salchaD-27
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythongraphicalmanipulator-0.1.0.tar.gz.
File metadata
- Download URL: pythongraphicalmanipulator-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e50d99e2e14797059d0759887c4dba4accecac80bef3e976075e2ebaeda8cde6
|
|
| MD5 |
aae07184d4f22a2b388b0993e2948ace
|
|
| BLAKE2b-256 |
bf918f37ec7297581805fb16c035505b4190e55ef4be75d83f5675b241cc09c4
|
File details
Details for the file pythonGraphicalManipulator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pythonGraphicalManipulator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a01e618307fb79a2a439e00cd07c30f4510e7d270941beadeaac1034ab30060
|
|
| MD5 |
296f836b5fa49b51dce250e93d3b0c86
|
|
| BLAKE2b-256 |
78db5fc12b507d54314973969c4b9561eaa1cd8e16f88267bceb205f62d6301a
|