/// <summary>
 /// Resets ColourInfo.Frequency fields, and removes colour not present in Colourmap.
 /// If Image has N pixels, and ColourMap has M colours, total time = 3M + Nlog(M) ~= N
 /// </summary>
 public void UpdateColourMapFromImage()
 {
     if (mOutput == null || ColourMap == null)
     {
         return;
     }
     UpdateColourMapFrequency();
     IColourInfo[] temp = ColourMap.ToArray();
     foreach (IColourInfo col in temp)
     {
         if (col.Frequency < 1 && !col.IsChecked)
         {
             ColourMap.RemoveColour(col.Colour);
         }
     }
 }
 public void RemoveFromPalette(Color colorToRemove)
 {
     ColourMap.RemoveColour(colorToRemove);
     ReplaceColour(colorToRemove, ColourMap.GetNearestColour(colorToRemove));
 }