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 hashes)

Uploaded Source

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