Why is a 16-bit TIFF much larger than the original RAW file?

Asked 8/9/2015

5 views

2 answers

0

I’m converting Canon .CR2 files to TIFF in Lightroom for a timelapse workflow in Photoshop. My source files are about 23.9 MB, but the exported TIFFs are about 132.7 MB. The images are 5760 × 3840, exported as 16-bit TIFF with no compression, and they appear to be single-layer files with no alpha channel.

I expected some increase because RAW stores mosaic sensor data and TIFF stores full RGB pixels after demosaicing, but the jump seems bigger than I expected. What accounts for the much larger TIFF size?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

11y ago

2 Answers

11

TIFF is a container format which supports a collection of other standards and like any container what's in it will be entirely down to what you (or whoever wrote the TIFF export you're using) has decided to put in it.

At a guess from the file size your converter has gone to 16bpc/RGB uncompressed. If so then that file size looks about right. If it is uncompressed we can confirm it easily...

5760 x 3860 = 22,118,400 (total pixels)

x 3 = 66,355,200 (3 colours per pixel, R/G/B)

x 2 = 132,710,400 (total image size in bytes where 16-bits = 2-bytes)

132.7Mb matches your original file size. The actual file will be a little larger to accommodate the TIFF header, metadata and possibly a preview.

As to why the TIFF is so much larger, there are a couple of main reasons:-

Interpolation - each pixel on the sensor is one of either R, G or B. To get to a full RGB image the raw converter estimates the two other colours (such as R/B for G pixel) from the surrounding pixels. That means our raw file only needs to store 1/3rd of the data that our TIFF does before we start. The truly raw uncompressed sensor data being stored is just under 39Mbytes in this case.

Compression then comes in and takes that 39Mb down further - compression can be tuned if you know what type and format the data is versus general purpose compression algorithms and in the CR2 case they use a lossless JPEG which seems to drop the size by around 25%.

More info: CR2 is actually a TIFF based format which stores a lossless greyscale JPEG (according to this page) which is referenced by ExifTool: Canon Raw File Format - which is worth a read if nothing else than for Phil Harvey's rant about some of the (many) inadequacies of TIFF.


Additional info to cover comments: The 'extra' 6Mb is probably 0's and is just padding to make the 14-bit values fit the 16-bit (2-byte) boundary which Lightroom needs to use as it works with whole bytes. Lightroom encodes the output to match the depth it has worked to even if TIFF supported 14-bits/channel uncompressed, which IIRC, it doesn't and if it did you can assume pretty much nobody has implemented it so you'd end up with technically correct TIFFs which nobody can open (and not for the first time in my experience).

Originally by user14028. Source · Licensed CC BY-SA 4.0

user14028

11y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

That size is normal for an uncompressed 16-bit RGB TIFF.

A RAW file like CR2 is not a full 3-channel image. It stores mostly the camera’s sensor data, often with compression, plus metadata. A TIFF export is a rendered image: each pixel now has full RGB values.

For your dimensions, the math is roughly:

  • 5760 × 3840 = 22,118,400 pixels
  • × 3 channels (R, G, B) = 66,355,200 samples
  • × 2 bytes per sample for 16-bit = 132,710,400 bytes

That is about 132.7 MB before adding TIFF header/metadata, so your result is exactly what you’d expect.

Why it’s so much bigger than RAW:

  • RAW stores one sensor value per photosite, not full RGB per output pixel
  • RAW is usually compressed or packed efficiently
  • TIFF here is uncompressed
  • TIFF may also include metadata and sometimes previews

So the increase is mainly from converting compact sensor data into a full-resolution, 16-bit, 3-channel image with no compression.

UniqueBot

AI

11y ago

Your Answer