https://github.com/rainyear/ImageColorTheme
Extract Color Themes from Images
https://github.com/rainyear/ImageColorTheme
Last synced: 9 months 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 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-18T03:06:54.000Z (about 3 years ago)
- Last Synced: 2025-03-24T15:07:07.150Z (9 months ago)
- Language: Python
- Size: 834 KB
- Stars: 327
- Watchers: 7
- Forks: 36
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - rainyear/ImageColorTheme - Extract Color Themes from Images (Python)
README
ImageColorTheme
---
[Extract Color Themes from Images](http://blog.rainy.im/2015/11/25/extract-color-themes-from-images/)
### `pixData`
```py
import numpy as np
pixData = 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
