[Skip top navbar]

Andrew Gregory's Web Pages

View of Perth city from Kings Park, 31°57'19"S 115°51'2"E

-

JPEG vs TIFF - My Research


This format comparison is for the purposes of determining which format is best to use while taking photographs. I personally treat every file created by the camera as a "negative", and keep that copy unaltered forever. If a photo needs work, then I'll save the re-worked file as a separate copy. It is very important to note that while working on a photo you must save using a lossless file format. JPEG is NOT lossless! While editing, save your photo as a BMP, TIFF, PSD, PSP or similar lossless format. Saving, closing, and re-opening while editing using JPEG will accumulate small changes that over time become large changes.

There is a regular debate on the Internet of the merits of JPEG vs TIFF storage of photographs. I wanted to find out for myself whether TIFF was really worth the huge file sizes.

First of all, I wanted to control the lighting as much as possible. This meant indoors. I also did it at night to minimise any possible outside influence. It is lit by flourescent lights on the ceiling, about 30 degrees towards the camera from the books, plus a small halogen light just above and behind the camera. To reduce the effects of flickering from the light, I tried for a reasonably long shutter time.

NOTE: I've since considered the possibility that the long shutter time used in this test may have added extra errors due to CCD noise. To try to eliminate that, I've conducted a second test outdoors using a much faster shutter speed.

The procedure I followed:

All the photos were taken within 60secs (JPEG at 23:55:05, TIFF1 at 23:55:21, TIFF2 at 23:55:41). Here are the settings as stored in the JPEG:

FileName: C:\temp\05070002.JPG FileSize: 1183 kBytes (1212180 Bytes) Date: 2001:05:07 23:55:04 (File Modification) Date: 2001:05:07 23:55:05 (Picture Shot) Quality: Fine Width x Height: 2048 x 1536 pixels Recording Mode: Single Shutter Program: Manual Control Flash Used/Mode/Intensity: No / Off / Normal Focusing Mode: Manual Focus Exposure Time: 0.8 sec. Aperture Stop: F8 Focal Length (Equiv.) Zoom: 7.13 mm (34 mm) 1.0 Digital Zoom: Off Exposure Comp. (Set.): None (None) Sharpness: Normal Saturation: Normal Contrast: Normal Light Metering: Multi White Balance: Manual Sensitivity: Normal Orientation: Normal ("Landscape") Bits per Pixel: 3.6 Distance (?): 796 mm (0.80 m, 31.34 inch, 2.61 feet, 0.87 yard) "Magic": 8:1 9:1 14:0 15:0 16:1 17:6619275(101,139) 18:16 19:16 Make, Model, Firmware: CASIO, QV-3000EX, Ver1.002 Data by DiCaInfo 1.4.0, (c) DiCaSoft, www.dicasoft.de

Unfortunately, it isn't practical to post the original files, so the following will have to do. The scene, resized to 640×480 and saved by Paint Shop Pro 7 at Q50:

Scene

Next:

To compare the photos, I loaded the BMPs into Paint Shop Pro 7. Then I used "Image, Arithmetic" to calculate the Difference, first between the JPEG and TIFF1, then between TIFF1 and TIFF2. The difference images look completely black. Note that the images below have been resized to 320×240 and saved by Paint Shop Pro 7 in JPEG format at Q50. All the statistics and histograms are based on the original 2048×1536 images. The histograms all used the "greyscale" channel. Here are the comparisons:

JPEG vs TIFF1 comparison
Difference
Unaltered JPEG/TIFF difference Histogram of unaltered JPEG/TIFF difference
Mean:2 Mode:2
Max diff:61
Difference, Equalized Histogram
Equalized JPEG/TIFF difference Histogram of equalized JPEG/TIFF difference
TIFF1 vs TIFF2 comparison
Difference
Unaltered TIFF/TIFF difference Histogram of unaltered TIFF/TIFF difference
Mean:1 Mode:1
Max diff:62
Difference, Equalized Histogram
Equalized TIFF/TIFF difference Histogram of equalized TIFF/TIFF difference

The "Max diff" value is the largest value in the histogram for which there was at least one pixel. It indicates the largest difference (error) present in the comparison.

A table summarising the levels of differences (example, 92.6% of JPEG vs TIFF and 96.5% of TIFF vs TIFF pixels have a difference of less than 6):

Proportions of pixel differences
Pixel
Difference
Percent Below
JPEG vs TIFF1TIFF1 vs TIFF2
0 0.0 0.0
1 13.6 16.7
2 43.7 50.7
3 67.5 74.8
4 81.0 87.2
5 88.3 93.4
6 92.6 96.5
7 95.3 98.1
8 97.0 99.0
9 98.0 99.4
10 98.7 99.7
11 99.2 99.8
12 99.5 99.9
13 99.7 99.9
14 99.8 99.9
15 99.9 99.9
16 99.9100.0
17 99.9100.0
18 99.9100.0
19100.0100.0
: : :
61100.0
(largest JPEG vs TIFF difference)
100.0
62100.0100.0
(largest TIFF vs TIFF difference)

As you can see, the TIFF1 vs TIFF2 errors peak sooner than the JPEG vs TIFF1 errors, indicating that overall there is a lesser amount of error in the TIFF images. However, the difference is hardly worth worrying about.


Conclusion

In my opinion, the TIFF1 vs TIFF2 comparison is an indication of the level of error present in every photo you take. The fact that the JPEG vs TIFF1 revealed only a fractional amount of extra error indicates that the Casio JPEG Fine mode keeps the quality very high indeed. Is it worth nearly a 600% increase in file size for the tiny amount of extra quality of the TIFF? What about the photos you may miss waiting 20sec for the photo to save instead of less than 2? The decision is yours!

My recommendation is: forget the TIFFs - use Fine JPEGs and take 6 times as many photos!


Caveats

Of course, these findings may only apply to the Casio QV-3000. They may also apply to similar Casio QV cameras. How well they apply to other cameras depends largely on the quality at which they can save JPEGs. It could be that other cameras which provide an easily accessible TIFF save option may apply more aggressive JPEG compression, thereby giving TIFFs a bigger quality advantage.

Some cameras, for example the Canon G1, can produce a file that contains more than the usual 8 bits of data per primary colour. In the case of the Canon G1 its RAW files contain 12 bits of data per primary colour (12bppc). This is useful when the camera runs out of dynamic range - when the difference between the darkest part of the scene and the lightest part is too great for the camera to measure. Extra bits of data mean the camera can handle larger differences. That means extra detail is captured in shadows and highlights.

Even cameras that offer RAW with 12bppc, their TIFF modes still offer only 8bppc. It's only the RAW files that offer a significant benefit over JPEGs.


-