Skip to main content

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

I am Karan Bedi, 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, I pioneer lightweight software solutions like colorwsap, designed for real-world applications.

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

colorwsap-0.1.2.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

colorwsap-0.1.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file colorwsap-0.1.2.tar.gz.

File metadata

  • Download URL: colorwsap-0.1.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.0

File hashes

Hashes for colorwsap-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e9926987e34ad5568c07832f2b63bcc91cb8ac8d1dd51a8b9846f491accfa5d1
MD5 90230d16cc39ee8f7b0f762c41b6e271
BLAKE2b-256 fb8ebf480d57bdbcee58681fc477608cfde93879a5868838afda20167ca307af

See more details on using hashes here.

File details

Details for the file colorwsap-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: colorwsap-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.0

File hashes

Hashes for colorwsap-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 701278f620108074729a7ffbe17da418be5b348fe6c03523c20af9c4d9eae116
MD5 37e6208a2256b171dad973182e17a335
BLAKE2b-256 45d781ba2931fe5dd3328747ffcdd001b6aa2fb3468d1a0b25a53b43726c6e7e

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