A library for extracting color palettes from images.
paletti provides four different ways for automatic color palette extraction from images and image URLs.
- A wrapper around PIL's adaptive palette conversion.
- A wrapper for the pictaculous API.
- A wrapper for the colorific palette extraction library (© 2012, 99designs).
- A k-means color palette extraction using scikit-learn. Additionally creates a color-reduced image with the palette colors.
Requirements: numpy
python setup.py install
Extract a 5-color palette from a local image using the PIL method:
paletti -m pil -k 5 -o <IMAGE_FILE>
Extract a 3-color palette from an image URL using k-means:
paletti -m k-means -k 3 -o -u <IMAGE_URL>
Type paletti --help
for all available options.
- Input image:
The extracted colors are print as a pretty table to stdout:
If the output tag is set, the palette is saved as an image:
- PIL palette
- Colorific palette
- Pictaculous palette
- K-Means palette