File size comparisons
 
One the question always asked about file formats is "which format is 'best'"? And of
course this question has no answer because what is 'best' for one purpose is not
best for all purposes. The second question always asked is "What file format is
smallest?". On the surface this sounds like an easy question to answer, but as
the charts show below, there are no absolute answers to this question either.
 
For our examples we'll use 4 images. 2 full color photo images, 1 black and white
photo, and 1 color illustration.
 
Example Files
|
Full Color Image (24 bit)
77,871 Unique Colors
375 x 280 Pixels
|
|
Full Color Image (24 bit)
58,487 Unique Colors
375 x 280 Pixels
|
|
Black and White Image (8 bit)
256 Unique Colors
375 x 280 Pixels
|
|
Full Color Image (24 bit)
21,904 Unique Colors
375 x 280 Pixels
|
 
 
Below is the first chart. The chart lists the file size for each image in
various file formats. This is traditional view of relative file sizes. If
you use the standard file settings you will archive results that are similar.
 
Notice:
      The TIFF image in the first example is actually larger than the BMP version.
      The JPG format is not the smallest file size for the last example.
 
File size in Kilobytes
 
 
Next is the same chart, but grouped by file type.
 
Notice:
      All of the Full color files have the identical size in the BMP format.
      The Black and White image is 1/3 the size of the color image.
      The amount of compression in the TIFF examples varies greatly.
      There is virtually no difference in the file size of the color vs B/W cat image in the JPG format.
 
Grouped by File Type
 
Apples to Apples?
 
While the above charts are technically correct, there is a small problem. They're wrong.
If you are going to compare file types, you need to do an apples to apples comparison. With
file types this is exceptionally difficult. In particular the GIF format only uses 256
unique colors. For some images there is no noticeable difference between a 256 colors and
25,600 colors. For other images the difference may be noticeable. In either case if you
are interested in comparing compression formats and file sizes, you need to compare
images with the same number of colors.Let's look closer at state seal image.
 
Most likely this image was intended to have less than 21,904 unique colors. The scanning
process almost always 'add' colors that are no more than slight variations of the
intended color. Likewise any anti-aliased eliminates add hundreds of shades to
the image that may not be intended.
 
If we simply reduced the colors in the original image, before saving to the various file
formats, the results of our file comparison will be quite different. We'll take our
original 21,904 full color image and save it as a GIF with 128 colors. (128 colors is
purely subjective. After looking at the original file and variations with fewer colors,
it was my opinion that the 128 color file was virtual identical.) After saving this
file as a 128 color GIF, we'll open the new file, then save it as a BMP, TIFF, and JPG.
(You can do this in Adobe with the 'save for web' option). The results are below.
 
A Better Comparison
 
And if we apply this idea to all the files.
 
Apples to Apples
 
 
What is obvious from this chart is that most of the compression from the GIF format
is simply from the the reduction in color. A very similar size file can be obtained
in the BMP and TIFF formats if the number of colors is simply reduced.