Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rainyear/imagecolortheme
Extract Color Themes from Images
https://github.com/rainyear/imagecolortheme
Last synced: about 23 hours ago
JSON representation
Extract Color Themes from Images
- Host: GitHub
- URL: https://github.com/rainyear/imagecolortheme
- Owner: rainyear
- License: mit
- Created: 2015-11-17T07:53:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-11-18T03:06:54.000Z (about 2 years ago)
- Last Synced: 2024-12-17T12:06:15.166Z (8 days ago)
- Language: Python
- Size: 834 KB
- Stars: 323
- Watchers: 8
- Forks: 36
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ImageColorTheme
---[Extract Color Themes from Images](http://blog.rainy.im/2015/11/25/extract-color-themes-from-images/)
### `pixData`
```py
import numpy as nppixData = np.array([[R, G, B], [R, G, B],...], dtype=np.uint8)
print(pixData.shape)
# (h, w, d)
```### MMCQ
```py
from ict.MMCQ import MMCQ
mmcq = MMCQ(pixData, maxColor)
theme= mmcq.quantize()
```### k-means
```py
from ict.KMeans import KMeans
km = KMeans(pixData, maxColor)
theme = km.quantize()
```### Results
![](imgs/mmcq_vs_kmeans.png)