Metadata-Version: 2.1
Name: majocol
Version: 0.1.5
Summary: pick major colors from image
Home-page: https://github.com/suzukey/majocol
License: MIT
Author: suzukey
Author-email: suzukey28@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: Pillow (>=7.2.0,<8.0.0)
Requires-Dist: numpy (>=1.19.1,<2.0.0)
Requires-Dist: scikit-learn (>=0.23.2,<0.24.0)
Project-URL: Repository, https://github.com/suzukey/majocol
Description-Content-Type: text/markdown

<p align="center">
  <img width="420px" src="https://raw.githubusercontent.com/suzukey/majocol/main/docs/img/majocol.png" alt='majocol'>
</p>

<p align="center">
  <em>Pick major colors from image</em>
</p>

<p align="center">
  <a href="https://pypi.org/project/majocol/" target="_blank">
    <img src="https://img.shields.io/pypi/v/majocol?color=blue" alt="Package version">
  </a>
</p>

---

**Documentation**:

**Demo**:

---

# MajoCol

## Requirements

Python 3.6+

## Installation

```shell
$ pip3 install majocol
```

## Example

```python
from majocol import color, convert

# Using Pillow (Open local image)
from PIL import Image

image = Image.open(<IMAGE_PATH>)
image_ndarr = convert.pillow_to_rgb_ndarr(image)
colors = color.pick(image_ndarr, 3)


# Using opencv-python (Open local image)
import cv2

image = cv2.imread(<IMAGE_PATH>)
image_ndarr = convert.cv2_to_rgb_ndarr(image)
colors = color.pick(image_ndarr, 3)


# Using requests (Fetch web image)
import requests

resp = requests.get(<IMAGE_URL>)
image_ndarr = convert.byte_to_rgb_ndarr(resp.content)
colors = color.pick(image_ndarr, 3)
```

<p align="center">&mdash; 🪄 &mdash;</p>

<p align="center">
  <i>MajoCol is licensed under the terms of the <a href="https://github.com/suzukey/majocol/blob/main/LICENSE">MIT license</a>.</i>
</p>

