public static Bitmap Clone( Bitmap source, PixelFormat format )
{
// copy image if pixel format is the same
if ( source.PixelFormat == format )
return Clone( source );
int width = source.Width;
int height = source.Height;
// create new image with desired pixel format
Bitmap bitmap = new Bitmap( width, height, format );
// draw source image on the new one using Graphics
Graphics g = Graphics.FromImage( bitmap );
g.DrawImage( source, 0, 0, width, height );
g.Dispose( );
return bitmap;
}