Skip to main content
jj_345
Known Participant
December 18, 2018
Question

Why are exported TIF files so large?

  • December 18, 2018
  • 4 replies
  • 4701 views

I'm using lightroom to make some simple adjustments to images from my Sony A7 RIII.  File sizes of raw files are 43MB.

When I export the full size pictures as ZIP compressed TIF files, they end up being about 200MB...  Any idea why that is and how to avoid such large files?  The tif files are just one layer...

    This topic has been closed for replies.

    4 replies

    Michael Prais
    Known Participant
    December 26, 2020

    I was asking this same question recently when I noticed that a 27MB image (from an Nikon D610 6016x4016) ballooned to 106MB when I chose to Edit in Photoshop from Lightroom. The replies here are the closest that I came to an explanation, but they really don't answer the above question. (I also have the same problem with my Sony A7 RIII.)

     

    I noticed the problem when I started to run out of storage on my SSD. I am compositing images, and one of my .tif images grew with Layers to over 1GB. I expect that Exporting to .tif produces the same problem.

     

    Looking into the image file tags with ExifTool and MATLAB and comparing them with the Adobe TIFF 6.0 and DNG 1.5 specifications and the ISO TIFF/EP specifications, my .tif files match the TIFF 6.0 spec from 1992: There is a short header, 106MB of pixel data, and a series of TIFF tags in a small Image File Directory. The 106MB of data appears to be a compressed version of 5824 cols x 3888 rows x 3 colors/pixel x 2 bytes/color = 135MB. The ZIP compression of runs of RGBRGBRGB data is not that efficient (135MB --> 106MB) because while a run of RRR or GGG or BBB are usually similar in values, the R, G, and B values in most any pixel are not. Camera RAW and DNG files separate the R, the two G, and the B values measured by the Color Filter Arrays and ZIP compress (Deflate) the "channels" separately and more effectively and efficiently. Camera RAW and DNG files use the more recent TIFF/EP specification (from 2013 and 2019) with its support for CFA image data. (To be precise, the .tif files created by Lr and ACR are created under the Profile 1 of TIFF/EP, which is compatible with TIFF 6.0 but includes ZIP compression. Camera RAW and .dng files are created under the more advanced Profile 2 of TIFF/EP.)

     

    Lr and ACR (and GIMP) read and write Camera RAW and DNG image files. They can "adjust" the individual pixels, but they cannot replace the pixels the way that Ps and other image editors can. PS does not save back to Camera RAW or DNG formats, but you could try saving as a PSD file for effective compression. (I have not tried this.) Ps or other image editors, viewers, and printers, however, require images formated in other ways. A TIFF 6.0 (.tif) file is perhaps the most common pixel (raster) image format.

     

    So, we're stuck creating large TIFF files from small Camera RAW or DNG image files when we want to use them in unspecified image editors and applications. You can Flatten your images to remove the layers (each Layer being the same size as the Background Layer (image)). You can also try to stay within Lr or ACR saving as DNG (as I am) and encourage your destination to use these Adobe products (or GIMP). Finally, you could reduce the size and perhaps the apparent quality of your images by saving to JPEG with Quality at 100 allowing for any size. (Each Save throws away some of the pixel information.)

     

    BTW, TIFF/EP (Camera RAW and DNG) has a place in the file structure for XMP (editing commands). TIFF 6.0 can be extended to hold XMP as a Tag. Cmd-/Crtl-S updates the XMP information in the open image file. I expect that Ps/ACR and Lr read either the included or the accompanying XMP data when they open either .tif or .dng files (as long as you have used Smart Objects in Ps for non-destructive edits, otherwise, it makes no sense to track the changes that have permanently changed the original file).

     

     

    D Fosse
    Community Expert
    Community Expert
    December 27, 2020

    There is no "problem" here. The difference is three channels at 16 bit depth, vs one single channel at 14 bit depth.

     

    A raw file from a Sony a7riii is around 42 MB.

     

    A 16 bit uncompressed PSD or TIFF from that raw file is around 247 MB.

     

    That's just how this works and it has nothing to do with Photoshop specifically. If you're going to process files from a 42MP camera, this is what you get.

    Michael Prais
    Known Participant
    December 27, 2020

    The "problem" is the unexpected, large increase in the file size.

    Your reply iis the closest that I have come to an explanation, but it is a bit terse and the part about a raw file being a one-channel grayscale is not the story.

    First, two disclaimers:

    I don't have a 42MB Sony A7RIII--I have a 24MB Sony A7III. The 5824 col x 3888 row cropped image that I discuss comes from that camera.

    I was making an educated guess based on options in the TIFF/EP standard to explain why ARW files so small compared to TIFF files of the same image. ARW files do not use a Planar Configuration of the color samples.

    Thanks for calling my hand, D, but the color samples in an ARW file are also not a 14-bit, one-channel, "grayscale" image.

     

    I examined the metadata in a readily available ARW file from a Sony A7II that I have since replace. The file contains of two JPEGs, a TIFF, and possibly two thumbnails. While I can't find a ARW spec on the web, it is obviously a derivative of the TIFF/EP standard (ISO 12234-2)--noteably since the TIFF tag Format = 'tif'.

     

    Filename: '/Users/michael/Desktop/sunset_cliffs_20180803-33.arw'

    FileModDate: '03-Aug-2018 15:48:24'

    FileSize: 25133056

    Format: 'tif'

    FormatVersion: [ ]

    Width: 6048

    Height: 4024

    BitDepth: 14

    ColorType: 'CFA'

    FormatSignature: [73,73,42,0]

    ByteOrder: 'little-endian'

    NewSubFileType: 0

    BitsPerSample: 14

    Compression: 'unknown'

    PhotometricInterpretation: 'CFA'

    StripOffsets: 793088 \* StripOffset(s) + StripByteCount = 25120230 ~ FileSize

    SamplesPerPixel: 1

    RowsPerStrip: 4024

    StripByteCounts: 24337152 \* = 4024 RowsPerStrip * 6048 PixelsPerRow * 1 SamplePerPixel

    XResolution: 350

    YResolution: 350

    ResolutionUnit: 'Inch'

    Colormap: [ ]

    PlanarConfiguration: 'Chunky'

    ...

     

    The 24.3MB = 4024 rows x 6048 columns allows a single byte (eight bits) for the 4x14 bits per RGGB pixel of the Color Filter Array (CFA) sensor. Each byte is not a 14-bit grayscale value describing the image at that pixel: It is 56 bits of data compressed into eight bits. Sony does not identify the compression algorithm ('unknown'), but it does identify the sequence of color samples as "in series" ('Chunky'). The Compression appendices in TIFF/EP describe JPEG compression as separating the four color samples and compressing them separately to get better results as I noted in my earlier post. Based on these items, it is likely each byte in the data stream carries only two bits of compressed-coded information for each of the four samples for each pixel.

     

    The explanation for the file expansion that occurs when converting between a RAW file (an ARW file in particular) and a TIFF file is that the 4x14 bits per RGGB pixel of the camera sensor is compressed into eight bits per pixel in a RAW file that is expanded into 3x16 bits per RGB pixel in a TIFF file. That is a factor of 6 = 3x16/8 expansion. (ZIP compression of the data in a TIFF file has a limited effect because it does not separate the color samples.)

     

    elie_dinur
    Participating Frequently
    December 18, 2018

    >> "I guess I wish there was a single format that stored the RAW files AND the lightroom edits (not in catalogue) to easily share while collaborating."

    Depends what you mean by "collaborating.". If the recipient will be revising or adding to your edits using Adobe software, then DNG. Otherwise, Tiff. And if your version is the final version and in Adobe RGB or sRGB space, it can be 8 bit/channel (half the file size).

    jj_345
    jj_345Author
    Known Participant
    December 18, 2018

    Thanks!  I guess I wish there was a single format that stored the RAW files AND the lightroom edits (not in catalogue) to easily share while collaborating. 

    D Fosse
    Community Expert
    Community Expert
    December 18, 2018

    There is: DNG.

    Press ctrl+S to save the Lightroom edits to the file header (as well as the catalog).

    D Fosse
    Community Expert
    Community Expert
    December 18, 2018

    The raw file is grayscale - one channel - at 14 bit depth. A TIFF is RGB - three channels - at 16 bit depth.

    The TIFF isn't "large", it's what a 7952 x 5304 pixel RGB image weighs in at. That's the native uncompressed size.

    The jpeg format goes the other way. It aggressively compresses the file by chunking up data and throwing away a lot of information in the process. The net result can be 2-5% of the TIFF file size - but the original quality is irretrievably lost and for this reason jpeg should never be used as a working format. The file deteriorates with every resave and eventually disintegrates completely.