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

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
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