I'm working through pset5's resize right now and I'm at the point where I've got to update the headers for the new file. I'm having trouble computing them, mainly because I can't really tell the difference between the two size fields I'm supposed to update: bfSize and biSizeImage. Simply put, what is the difference between the two?

From what I've gathered so far, bfSize is supposed to be the size of the entire new image, pixels, padding, and both headers, while biSizeImage is the size of the image minus both headers.

Am I right?

1 Answer 1


You are right! bfSize should store the size of the whole BMP file — the size of the BMP image + the size of the headers.

biSizeImage should store the size of the BMP image — the size of the RGBTRIPLEs + the total size of the padding.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .