# Color Thief

> JavaScript library that extracts the dominant colour and palette from an image, in the browser and Node.js

Source: https://talira.ai/catalog/color-thief-94c2spb6
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / color](https://talira.ai/categories/libraries/color)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Lokesh Dhakar](https://talira.ai/orgs/lokesh.md)

Color Thief is a JavaScript library, by Lokesh Dhakar, that extracts the dominant colour and a colour palette from an image in the browser or Node.js with the same API. It returns colours with hex and CSS values, whether each is dark and a readable text colour to put on it, and semantic swatches (Vibrant, Muted, DarkVibrant and others). It has full TypeScript types, a synchronous browser API and an async one for Node.js, runs inside a Web Worker through ImageBitmap or OffscreenCanvas, refines its result in three progressive passes, and can quantize in OKLCH for perceptually even palettes. It installs with `npm install colorthief` or from a CDN, and is MIT licensed.

## Links

- Website: https://lokeshdhakar.com/projects/color-thief/
- GitHub: https://github.com/lokesh/color-thief

## Problems it solves

- I want to tint my UI with the main colour of an album cover
- I need to pull a colour palette out of an uploaded image in JavaScript
- I want to pick a readable text colour over an image's dominant colour

## Features

- Dominant colour and palette from an image
- Semantic swatches such as Vibrant and Muted
- Readable text colour for each colour
- Browser and Node.js with the same API
- Web Worker support
- Progressive three-pass extraction
- OKLCH quantization

## Trust

Overall: 0.48 out of 1.
Signals: maintenance 0.45, adoption 0.83, momentum 0.57, community 0.54, backing 0.30, extensibility 0.00.

- last commit 3 months ago
- latest release v3.5.0 3 months ago
- 13.7k GitHub stars
- 21 contributors
- backed by Lokesh Dhakar

## Sources

[^1]: https://github.com/lokesh/color-thief/blob/master/README.md (checked 30 Nov 2026)
[^2]: https://github.com/lokesh/color-thief/blob/master/LICENSE (checked 30 Nov 2026)
