Skip to main content

Dominant colors in image

Project description

Fast colortheif

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

Installation

pip install fast_colorthief

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.1.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file fast-colorthief-0.0.1.tar.gz.

File metadata

  • Download URL: fast-colorthief-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 68fa3b380aa2fd9aff0bfe7cfd01d1cb1cc1f855039b17375a3e152420c46267
MD5 1fcf1a8dad8904d73ae71c284788ec27
BLAKE2b-256 c4d78244325daaf498c9ab2e1c3e3dbac75553ca33ae64abbf648d226ec29dee

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