Discover and explore top open-source AI tools and projects—updated daily.
algoliaCLI tool for extracting dominant colors from images, especially e-commerce fashion articles
Top 91.8% on SourcePulse
This library and CLI tool extracts dominant colors from images, primarily targeting e-commerce fashion items with centered objects and simple backgrounds. It offers a configurable pipeline for color tagging, benefiting users who need to enhance product search relevancy with visual attributes.
How It Works
The tool processes images through a pipeline: resizing/cropping for speed and focus, background detection using corner colors and flood fill, optional skin detection to ignore human skin tones, K-Means clustering to group similar colors, cluster selection based on size or ratio, and finally, color naming using a KNN algorithm trained on XKCD color data. This modular approach allows fine-tuning of each step for optimal results.
Quick Start & Requirements
pip install -r requirements.txtpython -c "import cv2; from color_extractor import ImageToColor; npz = np.load('color_names.npz'); img_to_color = ImageToColor(npz['samples'], npz['labels']); img = cv2.imread('image.jpg'); print(img_to_color.get(img))"Highlighted Details
Maintenance & Community
This project is released as-is and is no longer maintained by Algolia.
Licensing & Compatibility
The README does not specify a license.
Limitations & Caveats
The project is no longer maintained, and its precision may be hindered if images do not feature centered objects with simple backgrounds. Compatibility with newer Python versions or OpenCV releases is not guaranteed.
3 years ago
Inactive