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
git submodule update --init --recursive
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.5.tar.gz (754.9 kB view hashes)

Uploaded Source

Built Distributions

fast_colorthief-0.0.5-cp312-cp312-win_amd64.whl (61.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

fast_colorthief-0.0.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (67.4 kB view hashes)

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

fast_colorthief-0.0.5-cp312-cp312-macosx_12_0_universal2.whl (59.1 kB view hashes)

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

fast_colorthief-0.0.5-cp311-cp311-win_amd64.whl (60.7 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

fast_colorthief-0.0.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (67.1 kB view hashes)

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

fast_colorthief-0.0.5-cp311-cp311-macosx_12_0_universal2.whl (58.2 kB view hashes)

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

fast_colorthief-0.0.5-cp310-cp310-win_amd64.whl (60.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

fast_colorthief-0.0.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (67.1 kB view hashes)

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

fast_colorthief-0.0.5-cp310-cp310-macosx_12_0_x86_64.whl (58.2 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

fast_colorthief-0.0.5-cp39-cp39-win_amd64.whl (60.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

fast_colorthief-0.0.5-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (67.1 kB view hashes)

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

fast_colorthief-0.0.5-cp39-cp39-macosx_12_0_x86_64.whl (58.3 kB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

fast_colorthief-0.0.5-cp38-cp38-win_amd64.whl (60.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

fast_colorthief-0.0.5-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (67.0 kB view hashes)

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

fast_colorthief-0.0.5-cp38-cp38-macosx_12_0_x86_64.whl (58.3 kB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

fast_colorthief-0.0.5-cp37-cp37m-win_amd64.whl (60.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

fast_colorthief-0.0.5-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (68.0 kB view hashes)

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

fast_colorthief-0.0.5-cp37-cp37m-macosx_12_0_x86_64.whl (58.4 kB view hashes)

Uploaded CPython 3.7m macOS 12.0+ x86-64

fast_colorthief-0.0.5-cp36-cp36m-win_amd64.whl (60.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

fast_colorthief-0.0.5-cp36-cp36m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (68.0 kB view hashes)

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

fast_colorthief-0.0.5-cp36-cp36m-macosx_12_0_x86_64.whl (58.3 kB view hashes)

Uploaded CPython 3.6m macOS 12.0+ 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