Here is a easy to use Kmean API for favicon's of websites. This API will analyze the 16x16 favicon of the requested url and return the most prevalent color in the image.
You can read more about Kmean clustering and check out the app here.Use:To use the API just call the link with parameters:http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php
Parameters:url: Define the url you wish to analyze
http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php?url=http://visualpulse.net/
k (optional): number of color clusters.
Default: 3
http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php?url=http://visualpulse.net/&k=3
ignoreExtremity (optional): Enable/Disable the ignoring of color extremities (white and black)
Default: true
http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php?url=http://visualpulse.net/&k=3&ignoreExtremity=true
http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php?url=http://visualpulse.net/&k=3&ignoreExtremity=false
blackLevel, whiteLevel(optional): Level at which you cut off the extremities of black and white. This is the symmetric rgb equivalent (ex. rgb(10, 10, 10))
Defaults: blackLevel=10, whiteLevel=245
Max: 255
Min: 0
http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php?url=http://visualpulse.net/&k=3&blackLevel=10&whiteLevel=245
OutputThe API returns a JSON format of the data. Here is an example of the output:
Call:http://apps.visualpulse.net/kmean_chrome_color_stripe/api.php?url=http://visualpulse.net/&k=3
Output:{
"rgb": {
"r": 97,
"g": 107,
"b": 169
},
"hex": "616ba9",
"url": "visualpulse.net",
"k": 3,
"ignoreExtremity": true,
"blackLevel": 10,
"whiteLevel": 245
}