Overwhelmed by the frustration of inconsistent color matching in design work?
Well, This Python project allows you to detect and identify colors from an image using the OpenCV library and a CSV file containing color names and RGB values.
- Detect and identify colors in images
- Interactive user interface
- Real-time color analysis
- Programming Language: Python
- Libraries: OpenCV, Pandas
- CSV Data: Color names and RGB values
- User Interface: Command-line and OpenCV GUI
Before you begin, ensure you have the following libraries installed:
pip install pandas opencv-python
-
Clone the repository or download the project files.
-
Place the image you want to analyze in the project directory and specify its path in the
img_path
variable in the script. -
Ensure you have a CSV file (
colors.csv
) with color names and their corresponding RGB values. The CSV file should have the following columns: 'color', 'color_name', 'hex', 'R', 'G', 'B'. If you don't have this file, you can create one or find a pre-existing dataset. -
Update the
csv_path
variable in the script to point to your CSV file. -
Run the script:
python color_detection.py
-
The image will be displayed in a window. Double-click on any area of the image to detect the color in that region. The name of the detected color and its RGB values will be displayed below the image.
-
Press the 'Esc' key to close the image window and exit the program.
You can use the provided pic1.jpg
image for testing. The CSV file colors.csv
contains a list of colors and their corresponding RGB values.
This project was created by Shreya Malogi
Please note that this is a basic color detection application, and you can expand it further or integrate it into other projects as needed.
This project is licensed under the MIT License - see the LICENSE.md file for details.
MIT License
Copyright (c) 2021 SHREYA MALOGI
If you find this project interesting or useful, we'd love for you to show your support by giving it a ⭐ star on GitHub. It's a simple gesture, but it means a lot to us!
And if you're feeling inspired or want to contribute, feel free to 🍴 fork this repository. You can use it as a starting point for your own projects or propose changes and improvements via pull requests. We welcome collaboration!
Let's make this project even better together! 🚀