If you want to use the most dominant colors you are probably better of using the map method:
Output: https://www.dropbox.com/s/r9q74nqji6kdk9w/rainbow-8-colors.png
// Read source image.using (MagickImage image = new MagickImage(@"D:\images\png\rainbow.png")) { // Create collection to store top 8 colors.using (MagickImageCollection colors = new MagickImageCollection()) { // Get the histogram of the image (key = color, value = count). Dictionary<MagickColor, int> histogram = image.Histogram(); // Add the 'top 8 colors' to the collection.foreach (MagickColor color in (from c in histogram orderby c.Value descendingselect c.Key).Take(8)) { colors.Add(new MagickImage(color, 1, 1)); } QuantizeSettings settings = new QuantizeSettings { // Due to a bug you have to set it to null instead of DitherMethod.No.// This will be fixed in next release. DitherMethod = null }; // Create a color map with the 'top 8 colors'.using (MagickImage colorMap = colors.AppendHorizontally()) { // Map image to the colors in the color map. image.Map(colorMap, settings); } } // Save output image.Write(@"D:\images\png\rainbow-8-colors.png"); }