Honestly, if I were thinking about turning this into a product I would do a couple of things:
1) Expose an api or package as a lib: There are a ton of application-level uses for pulling colors out of an image (e.g. google or pinterest (image) search results, they fill the image block with the primary image color before loading the file). While pulling out a color palette isn't rocket science, it's something that I'd happily offload to someone else's code.
2) Give users a way to generate meaningful, complimentary palettes: Theres a lot of color theory that goes on when picking a complimentary/contrasting color palette. Most times I'm dealing with a dominant image I don't actually want it to blend in with the rest of the page, I want it to stand out and still look good. Give me some way to do this dynamically (see #1 above) and potential applications have now skyrocketed.
Just my $.02 having built a couple of apps that use similar tech. Could be a fun weekend project!
This color palette generator has had a long history on the web. Its first peak of popularity was eight and a half years ago when a clever programmer used the now defunct web service version to make a Facebook auto-colorizer user script. Back when I wrote this color palette generator (originally in Perl!), Unisys's LZW patents had just expired and I was eagerly awaiting updates to the popular image processing libraries of the day so I could extract colors from GIFs. I'm sure if I were to rewrite this script today, it would more accurately pick the colors. Maybe a rainy day project. As always, I welcome your feedback. If there is demand, I'll resurrect the web service.
BEVEL