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.3.tar.gz (2.8 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.3-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: colorwsap-0.1.3.tar.gz
  • Upload date:
  • Size: 2.8 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.3.tar.gz
Algorithm Hash digest
SHA256 b0edd8e3eaa9f09ab07b685d1652818906f9f3dcdcc8a5461adcc12cc5f3f497
MD5 46aa1014064b0c6dbb81973593653817
BLAKE2b-256 5e611fd2584ef22130d9d5dc68c941cf70a79d766eb96c2bd38605810dd8b4c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: colorwsap-0.1.3-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

Hashes for colorwsap-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0e89e8cf88ac74fbb14f6d22e46951c4f19245f23d7b9aae8ce5596c1b45e264
MD5 b30fa1917689404cd789da023c63171e
BLAKE2b-256 f532d59639a350659294c5d299f03e4a82a2f67bd37558bc2bb2a3180d485512

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