The MagickImage class has a TotalColors property that you can use for this:
using (MagickImage image = new MagickImage()) { image.Read("image.emf"); Console.WriteLine(image.TotalColors); }