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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
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