Digital File Sizes Explained

v1.0, 2005-10-04

It can be difficult to determine the quality of a digital image based on its file size. Digital services like scanning are often priced by file size in megabytes. If you have a 30MB file, how many megapixels is that? What is the difference between compressed and uncompressed file sizes? How many megabytes do you need to make a large print? This page attempts to answer these questions.

Image file size formula: (UNCOMPRESSED image formats)

width * height * color / 1,024,000 = Megabytes (MB)



  • Values for width and height must be pixels.
  • For color, use the Bytes/pixel number from this table:

Color Depth Bytes/Pixel
8 bit Grayscale (each pixel = 0 to 255) 1
16 bit Grayscale (each pixel = 0 to 65536) 2
24 bit RGB (8 bits for each R,G,B) "8 bit color" 3
32 bit CMYK (8 bits for each C,Y,M,K) 4
48 bit RGB (16 bits for each R,G,B) "16 bit color" 6


Examples

Each calculated file size is the uncompressed size.

  • Nikon D70 camera, High Quality JPG, 8 bit color:
    3000 * 2000 * 3 / 1024000 = 18 MB (17,578 KB)
  • Nikon D70 camera, Raw file, 16 bit color
    3000 * 2000 * 6 / 1024000 = 35 MB (35,156 KB)
  • 35mm transparency film scan, 4000ppi, 16 bit color
    5600 * 3700 * 6 / 1024000 = 121 MB (121,406 KB)
  • Flatbed scan, 8" x 10" @ 300dpi, 16 bit color
    (8 * 300) * (10 * 300) * 6 / 1024000 = 42 MB (42,187 KB)
  • Flatbed scan, 8" x 10" @ 600dpi, 16 bit color
    (8 * 600) * (10 * 600) * 6 / 1024000 = 169 MB (168,750 KB)
  • Flatbed scan, 4" x 5" @ 1200dpi, 16 bit color
    (4 * 1200) * (5 * 1200) * 6 / 1024000 = 169 MB (168,750 KB)
  • Printed Poster, 24" x 36" x 300dpi, 8 bit color
    (24 * 300) * (36 * 300) * 3 / 1024000 = 227 MB (227,812 KB)


Compression

When discussing the quality of digital files based on file size, comparisons should only be made based on uncompressed sizes. Compression algorithms will modify each image differently depending on the subject matter of the image. Therefore it is impossible to accurately compare the file size of two digital images once they have been compressed.

There are two types of file compression, "lossy" and "lossless". Lossy compression actually changes some of the original pixels and some details are lost. The most common type of lossy compression format is JPG. While the original JPG image out of a digital camera is fine, every time the file is saved again, detail is lost. If the same file is saved as a JPG a few times, significant quality is lost and cannot be recovered. Valuable originals should always be saved in a lossless format, like TIFF or RAW. TIFF files can be edited and saved any number of times without loss of detail because the compression does not alter any pixels. The trade off is that TIFF files do not compress as well as JPG.