I have an application where I need to resize the users picture to max. 50KB
To resize I use a Method that sizes the picture to a given Width/Height.
The picture is a Bitmap with max. 8BPP. (Width * Height * 8) = Size in Bits
What I need to know now is: How can I calculate the amount of pixels I need to cut off to reach a maximum size of 50 KB. The result should be as close to the maximum as possible. (Not just cut off more than enough).
There's a tolerance of some Kilo Bytes but not too much.