I have a screen shot I take in my mobile app. The screen shot takes about 32 KB when saved as a png on a disk.
I am sending these to a central SQL Server and 32 KB is too big for that amount of times I will need to store that screen shot (approx 2500 times a day).
Is there any kind of trickery that I can do to get it to save smaller?
Here is the code I am using now to take it from Bitmap
to bytes (to send to the server for storage):
MemoryStream stream = new MemoryStream();
_signatureImage.Save(stream, ImageFormat.Png);
return stream.ToArray();
_signatureImage
is a Bitmap
and is the screenshot in question.
Here is an example of the screen shot I am saving:
Things that pop to mind (but I don't know how to do them):
- Reduce the actual Height and Width of the image (but hopefully in a way that will not distort it).
- Change it to a black and white image (not sure if I will see any real space savings from this)
- Compress it more (I don't like this as much because then it is not readable from the database).
Note, this all has to be done programatically, and cannot take very long, so complex image manipulations are out.
Thanks for any help.