private static Image Crop(Image image, int newWidth, int newHeight) { int x = 0; if (image.Width > newWidth) { int excessWidth = image.Width - newWidth; x = excessWidth / 2; } return image.Crop(newWidth, newHeight, x); } }