Basically this renders a color wheel (in the Hue/Luminosity color space), where only the areas that match the most pixels in the source image are shown.
The saturation of the areas on the wheel is taken from the average saturation of the matching pixels in the image.
The code runs entirely locally in the browser, so no image is sent to my own server.