I went ahead an ran the following in FSI:
open System.Drawing
open System.Drawing.Imaging
let file = new Bitmap("planet.jpg")
let rect = new Rectangle(0, 0, file.Width, file.Height)
let img = file.Clone(rect, PixelFormat.Format32bppArgb)
img.Save("copy.bmp", ImageFormat.Bmp)
I used a blank 10,000px by 10,000px JPG file clocking in at 1,563,127 bytes according to Windows Explorer. The resulting copy.bmp
is 400,000,054 bytes, which is indeed a lot bigger than the input.
As @PaulAbbott said, this is because there's no compression in bitmap files. A 10,000 by 10,000 image at 32 bits per pixel will end up being stored as 3,200,000,000 bits, which is exactly 400,000,000 bytes or roughly 400 MB - which is around the size you posted.
If the file you got really was 500 MB and not around 400 MB, could you try hosting it somewhere? I'd like to take a look at it and see if I'm missing something here.