Ad

DominantColor: Image color detection using k-means clustering

DominantColor identifies the main colors in an image by converting to LAB color space and applying k-means clustering. It provides Mac and iOS apps for visualization and benchmarking.
Screenshot of indragiek/DominantColor homepage

DominantColor finds the most prominent colors within an image utilizing the CIE LAB color space and the k-means clustering algorithm. The project addresses the need for automated color analysis for various image-based applications. It converts images to LAB color space for better human perception and then uses k-means clustering to group similar pixels into dominant colors.

The project offers implementation in both Swift and C (for color space conversions). It supports multiple color difference algorithms (CIE76, CIE94, CIE2000) for varying levels of accuracy. Includes dedicated Mac and iOS applications to demonstrate functionality and facilitate benchmarking.

  • Color Space Conversion: Implements conversion between RGB, sRGB, XYZ and CIE LAB color spaces.
  • Color Difference Algorithms: Supports CIE 76, CIE 94, and CIE 2000 algorithms for color similarity measurement.
  • k-means Clustering: Utilizes the k-means clustering algorithm to group pixels by color similarity.
  • Downsampling: Includes image downsampling to manage computational complexity for large images.
  • Mac & iOS Apps: Provides intuitive applications for visualizing and testing the color detection results.
  • Extensible: The color space conversion functions are implemented in C, enabling potential expansion to other color space conversions.
  • MIT License: Open source and available under the permissive MIT license.

The project is actively maintained with recent commits and a clear understanding of potential scaling challenges. The core algorithms are well-documented, although further optimization of the k-means clustering parameters is ongoing. A small but engaged community exists through the author's Twitter account.

This project benefits developers and researchers needing automated color analysis tools for image processing tasks. Use cases include image indexing, content-based image retrieval, and visual analysis. DominantColor provides a readily usable solution for finding the most representative colors in an image, offering better performance and simpler integration than manual color selection methods.

Summarize:
Share:
Stars
987
Forks
92
Issues
6
Created
11 years ago
Commit
3 years ago
License
MIT
Archived
No
Updated 1 hour ago

Similar Repositories