I am trying to create an API which takes an image URL as input and returns back a color palette in JSON format as output.
It should work something like this: http://lokeshdhakar.com/projects/color-thief/
But should be in Python. I have looked into PIL (Python Image Library) but didn't get what I want. Can someone point me in the right direction?
Input: Image URL
Output: List of Colors as a palette
The color-thief library is also available in python: https://github.com/fengsp/color-thief-py
Example implementation :
palette(img)
returns a numpy array. Each row can be interpreted as a color:To get the top ten colors: