if (searching.PixelFormat == PixelFormat.Format8bppIndexed && dest.PixelFormat == PixelFormat.Format8bppIndexed)
{
ColorPalette cp = dest.Palette;
for (int index = 0; index < searching.Palette.Entries.Length; index++)
cp.Entries[index] = searching.Palette.Entries[index];
dest.Palette = cp;
dest.Save(@"E:\Temp\" + Path.GetFileName(file.FilePath));
}