Skip to main content

pick major colors from image

Project description

majocol

Pick major colors from image

Test Coverage Package version


Documentation:

Demo:


MajoCol

Requirements

Python 3.6+

Installation

$ pip3 install majocol

Example

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 = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
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)

— 🪄 —

MajoCol is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

majocol-0.1.6.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

majocol-0.1.6-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page