__re-sampling__the image. For example, starting with a 4096x2048 PNG (or whatever format) you're wanting to convert this to, say, 2048x1024 which preserves the aspect ratio but compresses the size by a factor of 4 (2 in each dimension).

You can't in general re-sample without having some impact on quality, because there's a necessary interpolation which introduces some blur between nearby pixels. However for most practical purposes this is OK. Don't worry about this because the algos have been worked out for many years and you aren't going to do better than using existing "off the shelf" ones.

There's a nice C# example project on this topic elsewhere on Code Project, and another that goes into more depth on the choice of re-sampling algorithm here.

Finally, you mentioned a 50% compression. If you mean 50% in total image size this requires a 1/SQRT(2) = 0.707 reduction in the X and Y dimensions. For example, an original 4096 X 2048 image is going to need to reduce to 2896.3 X 1448.15: In that case you will need to round to an integer number of pixels such as 2896 X 1448. Interpolation will generally be more optimum (and with computational optimisations more likely achieved) if you stick to reductions in each dimension by powers of 2, but in that case the minimum compression achieved will be 2x2 => 4 => 25% reduction in size.

I hope this helps.

Use

Improve questionto update your question.And check this link http://makeitsolutions.com/labs/jic/ or https://github.com/brunobar79/J-I-C its image compression. I want exactly the same thing but with asyncfileupload. Any leads will be much appriciated.