// Save a GIF, using OctTree pallettee. public static void SaveGif(Bitmap bitmap, string fileName) { OctreeQuantizer quantizer = new OctreeQuantizer(255, 8); using (Bitmap quantized = quantizer.Quantize(bitmap)) { quantized.Save(fileName, ImageFormat.Gif); quantized.Dispose(); } }