Material You color generation algorithms in pure python!
Maintained. Last release 7 days ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install materialyoucolorMaterial You color algorithms for python!
It is built in reference with offical typescript implementation except it's color quantization part, which is based on c++ implementation thanks to pybind.
Features
- Up to date with
material-foundation/material-color-utilities. - Uses official c++ sources for quantization backend, which makes color generation fast!
Minimal running example:
Run file tests/test_all.py as:
usage: test_all.py [-h] [--tonal-spot] [--expressive] [--fidelity]
[--fruit-salad] [--monochrome] [--neutral] [--rainbow]
[--vibrant] [--content] [--cmf] [--all] [--image IMAGE]
[--quality QUALITY] [--method {pillow,cpp}]
Material You Color Scheme Test
options:
-h, --help show this help message and exit
--tonal-spot Print the tonal-spot dynamic scheme
--expressive Print the expressive dynamic scheme
--fidelity Print the fidelity dynamic scheme
--fruit-salad Print the fruit-salad dynamic scheme
--monochrome Print the monochrome dynamic scheme
--neutral Print the neutral dynamic scheme
--rainbow Print the rainbow dynamic scheme
--vibrant Print the vibrant dynamic scheme
--content Print the content dynamic scheme
--cmf Print the cmf dynamic scheme
--all Print all dynamic schemes (default)
--image IMAGE Path to an image file for color extraction
--quality QUALITY Quality for image quantization (default: 5)
--method {pillow,cpp}
Method for color quantization (default: cpp)
Click to view result
It is recommended to use the backend, as the backend is extremely memory-inefficient for large images. Newer Pillow APIs such as eagerly materialize the entire image into a full list, so quality-based subsampling is applied only after full expansion and does not reduce memory usage. While allows sampling during iteration, it is deprecated.
