Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythongraphicalmanipulator-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythonGraphicalManipulator-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pythongraphicalmanipulator-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pythongraphicalmanipulator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e50d99e2e14797059d0759887c4dba4accecac80bef3e976075e2ebaeda8cde6
MD5 aae07184d4f22a2b388b0993e2948ace
BLAKE2b-256 bf918f37ec7297581805fb16c035505b4190e55ef4be75d83f5675b241cc09c4

See more details on using hashes here.

File details

Details for the file pythonGraphicalManipulator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pythonGraphicalManipulator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a01e618307fb79a2a439e00cd07c30f4510e7d270941beadeaac1034ab30060
MD5 296f836b5fa49b51dce250e93d3b0c86
BLAKE2b-256 78db5fc12b507d54314973969c4b9561eaa1cd8e16f88267bceb205f62d6301a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page