Calculating uncompressed JPG image file size

Published on October 3rd, 2019

image icon

I have yesterday found out this cool thing by reading some random article on the internet, so I thought I’d share it. Calculating size of uncompressed jpg is as easy as multiplying image width, height (in px) and number 3. Why 3 you may ask? It’s because 3 bytes are equivalent to 24 bits (size of RGB color). Current result will be in bytes so you can easily convert it to megabytes by dividing with 1048576 (1024 × 1024).

size = (width × height × 3) / 1048576