You may find this post by Wade Cosgrove of Panic interesting<p><a href="http://www.panic.com/blog/2012/12/itunes-11-and-colors/" rel="nofollow">http://www.panic.com/blog/2012/12/itunes-11-and-colors/</a>
How I'd do it:<p>1. pick 500 random points from the album art<p>2. cluster them in 10 classes (k-means is an old, well understood algorithm)<p>3. pick the median point of dominant class for the bg<p>4. pick a contrasting color from a different cluster for the text
How I'd do it: Use Embedly! Our extract API returns the dominant colors of all the images it finds: <a href="http://embed.ly/docs/extract/api/response#extract-images" rel="nofollow">http://embed.ly/docs/extract/api/response#extract-images</a><p>For those that are curious, what happens under the covers is a random sampling of the image followed by a conversion to LAB color space (even better than YUV in terms of human perception) and finally some K-means clustering.<p>To see this in action, check out <a href="http://tightro.pe" rel="nofollow">http://tightro.pe</a>.
They also use a similar trick based on the icon colors for the iTunes ios app update feature (for those of us who still like plugging our phone or tablet into the USB cable). In the latest iTunes, when you click on an app in icon mode to find out what's new in the update, the background reflects the colors of the icon, which can make for some odd combinations...