cooperhewitt/palette-server — pull request #2 by nator (2013-12-09 02:54:43+00:00)
Title: Add human-eyes magic colors for edge case saturation events

I finally had a moment to experiment with my feedback from here: https://twitter.com/homebrewer/status/401065453453197312.

Feel free to reject or modify or ignore, but IMO this improves the color detection by making it a bit more human. It goes two ways: 1) boost all color "areas" by saturation, as if saturated colors take up more room in the image. 2) add a "magic" color if a few conditions are met: not already included, more than 2x the average image saturation, and above the minimum area for inclusion.

![geyser](https://f.cloud.github.com/assets/343170/1702017/97df754c-607c-11e3-8ebc-39d82dad719b.png)

It picks up my pet peeve: http://collection.cooperhewitt.org/objects/18564781/, does good work on http://collection.cooperhewitt.org/objects/18476589/, and IMO (without magic) improves http://collection.cooperhewitt.org/objects/18471835/. The vast majority are unchanged but there are a few subtle boosts regarding saturation that I think make things jive a little closer with how people see images.

![palms](https://f.cloud.github.com/assets/343170/1702034/1e584b9e-607d-11e3-9a8d-a18f55049f98.png)

I also added a "debug" parameter for my own ease since I don't robot hex colors: http://localhost:8000/?path=/home/path/test3.jpg&debug=true -- this generates a simple page showing colors found. Super handy for quick tests and debugging.