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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fast_colorthief-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl (73.0 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl (54.5 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

fast_colorthief-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl (73.0 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

fast_colorthief-0.0.3-cp35-cp35m-manylinux2010_x86_64.whl (73.0 kB view details)

Uploaded CPython 3.5mmanylinux: glibc 2.12+ x86-64

File details

Details for the file fast_colorthief-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: fast_colorthief-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for fast_colorthief-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a97ef9e17e7550df9a20fa7037dd98dd5fd28edc31e549102516414ddea2827b
MD5 9e3c216b47bebd5805ef1b0dd2d8b9e8
BLAKE2b-256 546f81e816e1e6705536c4c2642606ad696002a9bfc9e35cbd9ef68710490618

See more details on using hashes here.

File details

Details for the file fast_colorthief-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fast_colorthief-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 54.5 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for fast_colorthief-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 50335f9c9a60690b61bda344d192bc1b21ced8753b405c40cf01587c6a468567
MD5 af4e29b43e5875288854c306cc60a316
BLAKE2b-256 c126482a90236e69245b696d96f0b90614bad885280a01dbdfd1da2658d44f3a

See more details on using hashes here.

File details

Details for the file fast_colorthief-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: fast_colorthief-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for fast_colorthief-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 06a9b01d8df6fbf17888bd4d7a912889edb14da2f6a677a9e99c7b6d0079fe2e
MD5 49c509c55ab3970937c5297f47f61e05
BLAKE2b-256 6d252f59bf280fba2aab36f345cf345c523e633121e303dfedde34cfbed1ad97

See more details on using hashes here.

File details

Details for the file fast_colorthief-0.0.3-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: fast_colorthief-0.0.3-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for fast_colorthief-0.0.3-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 53f37e4afaf897ea4befd88607f7f157ea56149b00ace20f34e240b637a4ba54
MD5 8255792230648993f9762840fb25a0cd
BLAKE2b-256 d4c9c39d7335fa46974bb6d92a68c64223d36160a86985fedfac05dc4e14a851

See more details on using hashes here.

Supported by

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