mmcq.py – Python implementation of Modified Median Color Quantization (MMCQ)
goal of this project is write JS implemntation MMCQ in python.
MMCQ?
See more at Color quantization using modified median cut by Dan S. Bloomb
Usage
To get sample palette, you can use mmcq.get_palette.
from mmcq import get_palette
from PIL import Image, ImageDraw
# create an image
out = Image.new("RGB", (1000, 1000), (255, 255, 255))
d = ImageDraw.Draw(out)
with get_palette('something.jpg', 8) as palette:
for i, color in enumerate(palette):
d.rectangle((((i - 1) * 100, 0), (i * 100, 100)), fill=color)
out.show()
To get dominant color, you can use mmcq.get_dominant_color which color is frist of mmcq.get_palette.
>>> from mmcq import get_dominant_color
>>> get_dominant_color(filename='/image/something.jpg')
(255, 234, 0)
See more at Color thief.
Changelog
0.1.0
Only Python3 support.
Default image library changed from Wand to Pillow.
Metadata
Release files for mmcq.py 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mmcq.py-0.1.1.tar.gz | 5.2 kB | Without provenance | Details for mmcq.py-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mmcq.py-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mmcq.py-0.1.1-py3-none-any.whl |
Total release size: 12.2 kB
Release files / mmcq.py-0.1.1.tar.gz
| Download URL | mmcq.py-0.1.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a178a3ba0d847078b8d81dbd969130399caf97304e2489738b2ae1200d94e8b7
|
|
BLAKE2b-256 checksum How to use checksums |
02f48815f7ff80e1fea3c39ae28f74ce830c75f30b07a8d5a602d629934c3b3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
|
Release files / mmcq.py-0.1.1-py3-none-any.whl
| Download URL | mmcq.py-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49cc669ba3704bb3d8c56da835773992c2b05985b1940725de84f8bf404c844f
|
|
BLAKE2b-256 checksum How to use checksums |
3ebfc5aa33087f4febcb253106787a872e3842b3bfce57f22e4c7d03f562c242
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
|
Security for mmcq.py 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.