How do you update the total file size of an image and its total size? (height and width) I've been struggling for 1 month and I can't seem to calculate it. Any hints out there?

1 Answer 1


The new file needs a file header and a bitmap info header just like the one you read, with four fields in total being different: width, height, bitmap size, file size.

New width and height are calculated from the old ones times the factor.

The bitmap size is the line length (width times bytes per pixel, plus padding) times absolute image height. (negative image height means image is stored upside down)

File size is bitmap size plus size of the headers.

You must log in to answer this question.

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