Product Engineer, CTO & a Beer Enthusiast
Experiments, thoughts and scripts documented for posterity.
Aug, 2013
Following is a continuation to my github project at https://github.com/karthik20522/DominantBackgroundColor
![]() |
![]() |
![]() |
![]() |
Result | Result | Result | Result |
//This function would return the most dominant color in the image. The examples above are the result of this function
var dominantHTMLColor = await new DominantColor().GetDominantColor(imageURI);
//This function would return the closest match to rainbow colors
var closestHTMLColor = _dominantColor.GetClosestColor(dominantHTMLColor);
![]() |
![]() |
![]() |
![]() |
Actual | Actual | Actual | Actual |
Subset | Subset | Subset | Subset |
var colorsWithCount = GetPixels(bitmap)
.GroupBy(color => color)
.Select(grp =>
new
{
Color = grp.Key,
Count = grp.Count()
})
.OrderByDescending(x => x.Count)
.Take(5); //take top 5 color