How does the color extraction work?
The tool uses an iterative Median Cut algorithm to extract dominant colors from your image. The image is downsampled to 200x200 pixels for speed, then all pixel colors are read via the browser Canvas API. Starting from one bucket containing every pixel, the algorithm repeatedly finds whichever current bucket has the greatest color range on any channel, sorts that bucket by that channel, and splits it at the median. This continues until the target number of buckets is reached. Each bucket is then averaged to produce one representative color, and the results are sorted from lightest to darkest by perceived luminance.