Vibrant.js: Extract prominent colors from an image
jariz.github.io
jariz.github.io
Edit: Interestingly, it looks like it may sample the image at its visible size and not the full source image. If I resize my browser, triggering various media queries and thus image sizes, the dominant colors change after reloading.
At first I thought it would be the same, since the percentage of each color should be roughly equivalent; but then again, the images themselves are being resampled on resize, so there may be individual pixel colors in one size image that aren't in another.
Still, though, the point of a proper resampling algorithm is to maintain the same general perceived appearance of the image at different sizes; assuming it is doing this well, you should expect to see the same dominant colors.
Of course, the algorithm also might just be sampling every nth pixel, which would mean a different sample group depending on the size.
http://steamy-screenshots.herokuapp.com/
https://github.com/moneypenny/steamy-screenshots
You can specify a steam username or game title and it will pull in screenshots and use the extracted colors to style the page.
I think she used a port of Panic's iTunes album art color algorithm. I am not sure if she had heard of Vibrant.js or not.
The basic idea is to get the histogram and check for dominant colors.
(There are other implemented features as well, like texture, if you're interested)
[1] http://stackoverflow.com/questions/13637892/how-does-the-alg...
Could be useful for web design. The other way around often does not work, because once you are stuck on a palette you need to find images that match it.
You can also use the "quantize" module on npm to get prominent colours. Example: https://www.npmjs.com/package/get-rgba-palette