Socket
Socket
Sign inDemoInstall

fast-colorthief

Package Overview
Dependencies
2
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fast-colorthief

Dominant colors in image


Maintainers
1

Readme

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

AlgorithmTime 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.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc