The color positioning loop is the most heavy part in generatePalette, so make it possible to position colors in parallel when the valid sample size is larger than 256x256 (65536) before one CPU core gets exhausted.
Test: