lokesh/color-thief

Grab the color palette from an image using just Javascript. Works in the browser and in Node.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 21 minutes ago
Added to GitGenius on September 4th, 2026
Created on November 1st, 2011
Open Issues & Pull Requests: 1 (+0)
GitHub issues: Enabled
Number of forks: 1,314
Total Stargazers: 13,627 (+0)
Total Subscribers: 164 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 185.2 days
Mean response time: 651.9 days
90th percentile: 2320.4 days
Tracked items: 79

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 2% of issues opened in the past year have been closed. Three people close 98% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • type:bug (8)
  • type:feature-request (7)
  • algorithm (5)
  • improve docs (4)
  • status:needs-review (4)
  • status:ready-for-work (4)
  • resolution:resolved (3)
  • resolution:unable-to-recreate (3)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Color Thief is a JavaScript library that extracts dominant colors and color palettes from images in both browser and Node.js environments.

The library solves the problem of programmatically analyzing image color composition. It works by sampling pixels from an image, quantizing them into a palette using perceptually uniform color spaces, and returning semantic color swatches labeled by characteristics like Vibrant, Muted, DarkVibrant, and LightMuted. The tool offers both synchronous extraction for browser use and asynchronous APIs for Node.js, with a progressive three-pass refinement mode that delivers rough results instantly before refining them further. It includes rich Color objects that expose multiple output formats—hex, RGB, HSL, OKLCH—along with WCAG contrast ratios and automatic text color recommendations for accessibility.

Developers should choose this tool if they need client-side color extraction without server dependencies, particularly for interactive applications like image editors, theme generators, or dynamic UI styling. The library suits projects requiring both browser and Node.js support with a unified API. It distinguishes itself through perceptually uniform OKLCH quantization for more natural palettes, semantic swatch categorization, reactive observation of live video and canvas elements, and Web Worker compatibility via ImageBitmap and OffscreenCanvas. The CLI tool enables command-line extraction with JSON, CSS, and ANSI output. The project carries zero runtime dependencies and includes full TypeScript definitions.

Development activity shows consistent maintenance with regular updates addressing edge cases and feature refinement. The project demonstrates responsiveness to user-reported issues and maintains backward compatibility across releases. Documentation is thorough with clear API examples and detailed option descriptions. The codebase reflects attention to performance optimization, particularly in the progressive extraction and worker-friendly design patterns.