Swap PNG logo colors easily by name or RGB
Project description
colorwsap
Swap the color of non-transparent areas in a PNG image by specifying a file path, color (name or RGB tuple), and output file.
Installation
pip install opencv-python numpy
colorwsap
colorwsap is a lightweight Python package designed to easily swap the color of the non-transparent parts of PNG images. Whether you're customizing logos, icons, or other assets, colorwsap lets you do it quickly by specifying a file path, a target color (by name or RGB), and an output filename.
Features
- Supports common color names mapped to RGB values.
- Preserves transparency while changing visible colors.
- Simple and minimalistic API for quick integration.
- Dependable on OpenCV and NumPy for efficient image processing.
Usage
from colorwsap import swap_color
swap_color("input.png", "red", "output.png") swap_color("input.png", (0, 128, 255), "output.png") # RGB tuple swap_color("input.png", "magenta", "output.png")
- Supported colors: red, green, blue, white, black, yellow, cyan, magenta, grey, silver, maroon, olive, purple, teal, navy, orange, pink.
- The function replaces all visible pixels with the chosen color, preserving transparency.
About Me
Karan Bedi is a final-year engineering student passionate about machine learning, automotive innovation, and software development. With strong technical skills and a vision for integrating AI technologies with automotive products, Karan pioneers lightweight software solutions like colorwsap designed for real-world applications.
This content can be used as the README.md to automatically populate your PyPI project page and give users a clear understanding of your package and who you are as the author.
If you want me to generate the exact text content for any of these sections in a ready-to-use format, please let me know!
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
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 colorwsap-0.1.1.tar.gz.
File metadata
- Download URL: colorwsap-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f18a120b0732a927c330a91404275daa72262f17f2bf13531375766b1bb59b9
|
|
| MD5 |
4d7ff46143eb4462f8e6b61a46466ae7
|
|
| BLAKE2b-256 |
b335501725ef7e67d53862e56d90f42bb9c3c5fd892ade6c26e5322d3fbfebe8
|
File details
Details for the file colorwsap-0.1.1-py3-none-any.whl.
File metadata
- Download URL: colorwsap-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9d22ca0148f4adb781e58a95cbfb9f286583497c288858daa5f02a624e3b8ad
|
|
| MD5 |
7b1cd0300aad00c2cedcecf0ba8c81e2
|
|
| BLAKE2b-256 |
7bff9c24a2394aa7c2df211fee6b8419306221a95b3e64d903be1246f1613cd4
|