The Color Thief package includes multiple distribution files to support different environments and build processes. Gets the dominant color from the image. Color is returned as an array of three integers representing red, green, and blue values. When called in the browser, the image argument expects an HTML image element, not a URL. When run in Node, this argument expects a path to the image. quality is an optional argument that must be an Integer of value 1 or greater, and defaults to 10. The number determines how many pixels are skipped before the next one is sampled. We rarely need to sample every single pixel in the image to get good results. The bigger the number, the faster a value will be returned. Gets a palette from the image by clustering similar colors. The palette is returned as an array containing colors, each color itself an array of three integers.

Features

  • There are multiples ways to install Color Thief when using it in the browser
  • The distribution files are hosted on cdnjs for quick access
  • The ColorThief methods return colors as an array of three integers representing red, green, and blue values
  • Both the getColor() and getPalette() methods return a Promise when used in Node
  • Includes multiple distribution files to support different environments and build processes

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Color Thief

Color Thief Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Color Thief!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Image Recognition Software

Registered

2021-06-15