Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 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

![](imgs/mmcq_vs_kmeans.png)