[Solved] Size of image increases after cropping


Telepathic power: you are talking about size of file on disk and comparing original compressed file (likely JPG) with cropped version saved in non-compressed format (likely BMP).

Fix: save cropped image in compressed format.

Image.Save with 2 arguments lets you specify format (i.e. unlike one argument version you use in your sample).

Example from the article:

// Construct a bitmap from the button image resource.
Bitmap bmp1 = new Bitmap(typeof(Button), "Button.bmp");

// Save the image as a GIF.
bmp1.Save("c:\\button.gif", System.Drawing.Imaging.ImageFormat.Gif);

2

solved Size of image increases after cropping