Python port for node-vibrant to extract color palettes from images in format similar to palettes in Android.
python -m pip install vibrant-python- Color palette extraction
- Fully typed codebase
- Color space conversion utilities
- Contrast ratio calculation
This library is a one-to-one port of the node-vibrant package which itself is port of Vibrant.js. They all aim to produce color palette from images in format similar to the Palette module in Android. The primary use-case of this for me was to produce colors from album cover arts (simply extracting the most prominent colors isn't always the best fit in most cases and requires a more sophisticated solution) where such color palettes work well.
The Python codebase is fully typed so great editor support is expected for intuitive use. Check out Docs for more info.
from vibrant import Vibrant
v = Vibrant()
palette = v.get_palette('/path/to/image')
color = palette.dark_muted
print(color.rgb)