I would try to convert the image to compressed jpeg. The good thing about jpegs is that you can set how high quality it should be (that is, how much you want it to be compressed):
Note: The quality should be from 1 to 100 (100 is the largest size / highest quality, and 1 is the smallest size / lowest quality.
public void save(string filename, Bitmap img, int quality) { // quality encoding EncoderParameter qualParam = new EncoderParameter(Encoder.Quality, quality); // code for jpeg image type ImageCodecInfo jpegCodec = FindEncoderInfo("image/jpeg"); EncoderParameters encoderParams = new EncoderParameters(1); encoderParams.Param[0] = qualParam; img.Save(filename, jpegCodec, encoderParams); } private ImageCodecInfo FindEncoderInfo(string mimeType) { // search through all codecs for all formats ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); for (int i = 0; i < codecs.Length; i++) { if (codecs[i].MimeType == mimeType) { return codecs[i]; } } return null; }
source share