Skip to main content

Dominant colors in image

Project description

Fast colorthief

A Python module for selecting most dominant colors in the image. Based on https://github.com/fengsp/color-thief-py but faster.

Installation

Linux, MacOS 10.15 or newer:

pip install fast_colorthief

Other operating systems (CMake required):

git clone https://github.com/bedapisl/fast-colorthief
cd fast-colorthief
pip3 install .

Example

import fast_colorthief

image_path = 'image.jpg'

dominant_color = fast_colorthief.get_dominant_color(image_path)
color_palette = fast_colorthief.get_palette(image_path)

Benchmark

1200 x 1200 jpg image

Algorithm Time per image
Fast colorthief (input numpy array) 0.0012s
Fast colorthief (input filename) 0.034s
Reference (https://github.com/fengsp/color-thief-py) (input filename) 0.509s

How does it work

Backend is written in C++ for better performance.

Uses Modified Median Cut Quantization algorithm.

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

fast-colorthief-0.0.4.tar.gz (753.5 kB view hashes)

Uploaded Source

Built Distributions

fast_colorthief-0.0.4-cp311-cp311-win_amd64.whl (62.1 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

fast_colorthief-0.0.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (68.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

fast_colorthief-0.0.4-cp311-cp311-macosx_12_0_universal2.whl (59.6 kB view hashes)

Uploaded CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64)

fast_colorthief-0.0.4-cp311-cp311-macosx_11_0_universal2.whl (59.8 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64)

fast_colorthief-0.0.4-cp311-cp311-macosx_10_15_universal2.whl (59.2 kB view hashes)

Uploaded CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64)

fast_colorthief-0.0.4-cp310-cp310-win_amd64.whl (62.2 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

fast_colorthief-0.0.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (68.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

fast_colorthief-0.0.4-cp310-cp310-manylinux2010_x86_64.whl (72.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.4-cp310-cp310-macosx_12_0_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

fast_colorthief-0.0.4-cp310-cp310-macosx_11_0_x86_64.whl (59.8 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

fast_colorthief-0.0.4-cp310-cp310-macosx_10_15_x86_64.whl (59.2 kB view hashes)

Uploaded CPython 3.10 macOS 10.15+ x86-64

fast_colorthief-0.0.4-cp39-cp39-win_amd64.whl (61.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

fast_colorthief-0.0.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (68.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

fast_colorthief-0.0.4-cp39-cp39-manylinux2010_x86_64.whl (72.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.4-cp39-cp39-macosx_12_0_x86_64.whl (59.7 kB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

fast_colorthief-0.0.4-cp39-cp39-macosx_11_0_x86_64.whl (59.9 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

fast_colorthief-0.0.4-cp39-cp39-macosx_10_15_x86_64.whl (59.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

fast_colorthief-0.0.4-cp38-cp38-win_amd64.whl (62.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

fast_colorthief-0.0.4-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (68.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

fast_colorthief-0.0.4-cp38-cp38-manylinux2010_x86_64.whl (72.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.4-cp38-cp38-macosx_12_0_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

fast_colorthief-0.0.4-cp38-cp38-macosx_11_0_x86_64.whl (59.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

fast_colorthief-0.0.4-cp38-cp38-macosx_10_15_x86_64.whl (59.2 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

fast_colorthief-0.0.4-cp37-cp37m-win_amd64.whl (62.0 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

fast_colorthief-0.0.4-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (69.4 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

fast_colorthief-0.0.4-cp37-cp37m-manylinux2010_x86_64.whl (73.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.4-cp37-cp37m-macosx_12_0_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.7m macOS 12.0+ x86-64

fast_colorthief-0.0.4-cp37-cp37m-macosx_11_0_x86_64.whl (59.8 kB view hashes)

Uploaded CPython 3.7m macOS 11.0+ x86-64

fast_colorthief-0.0.4-cp37-cp37m-macosx_10_15_x86_64.whl (56.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.15+ x86-64

fast_colorthief-0.0.4-cp36-cp36m-win_amd64.whl (62.0 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

fast_colorthief-0.0.4-cp36-cp36m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (69.4 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

fast_colorthief-0.0.4-cp36-cp36m-manylinux2010_x86_64.whl (73.0 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.4-cp36-cp36m-macosx_12_0_x86_64.whl (59.6 kB view hashes)

Uploaded CPython 3.6m macOS 12.0+ x86-64

fast_colorthief-0.0.4-cp36-cp36m-macosx_11_0_x86_64.whl (59.8 kB view hashes)

Uploaded CPython 3.6m macOS 11.0+ x86-64

fast_colorthief-0.0.4-cp36-cp36m-macosx_10_15_x86_64.whl (59.2 kB view hashes)

Uploaded CPython 3.6m macOS 10.15+ x86-64

fast_colorthief-0.0.4-cp35-cp35m-manylinux2010_x86_64.whl (73.0 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

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