Allow the user to optionally define a few that would have to be obligatorily present on the end palette, and then let the program choose the rest, just in case he/she has a few reserved colors.
How?
The histogram of the quantizer would be prepopulated with those colors, putting an artificially high value on the color count of the corresponding slots on the histogram.
After the colors are reduced, the final palette may need to be reordered to fit what the user passed.
Objective
Allow the user to optionally define a few that would have to be obligatorily present on the end palette, and then let the program choose the rest, just in case he/she has a few reserved colors.
How?
The histogram of the quantizer would be prepopulated with those colors, putting an artificially high value on the color count of the corresponding slots on the histogram. After the colors are reduced, the final palette may need to be reordered to fit what the user passed.