Q:

C#: How to uncompress an image received in a base64 encoded format?

First I upload a .bmp image of size 7KB to a server and then when required I send a request to the server to get that image and the image would be sent in base64 encoded format. If I save that file to a .bmp format the saved image would look exactly like the one I uploaded but it's size would be around 4KB. 
I think that while uploading the image is being compressed. If it is, how to I uncompress it.
I'm saving the image in with the following code:
MemoryStream stream = new MemoryStream(Convert.FromBase64String(strImageInBase64Format));
Bitmap bmp = new Bitmap(stream);
bmp.Save("some.bmp");

A:

Just rewriting what @Martheen posted in comments to provide an answer.
The function that I've been using to save the image is:
bmp.Save("some.bmp");

From the microsoft document of this function (https://msdn.microsoft.com/en-us/library/ktx83wah(v=vs.110).aspx):

If no encoder exists for the file format of the image, the Portable Network Graphics (PNG) encoder is used.

So, even though I've been saving the image in .bmp format the image is actually being encoded in png format and then just save with .bmp extension.
To save the image from base64 string to .bmp format, I should use the function:
Image.Save Method (String, ImageCodecInfo, EncoderParameters)

Sample code

