How it works
The image is drawn into an HTML canvas in your browser. Clicking reads that pixel with getImageData. Dominant colors are found by grouping pixels into 4,096 buckets (4 bits per channel), averaging each bucket and keeping the largest buckets that are clearly different from each other.
Tips
- JPEG compression changes colors slightly around edges; click in a flat area.
- Screenshots preserve exact colors better than photos.
- Large images are scaled to 900 px wide for speed, which averages neighboring pixels.