Results 1 to 14 of 14

Thread: TIF SIZE VS RAW FILES

  1. #1
    Bill McCrystyn
    Guest

    Default TIF SIZE VS RAW FILES

    Why are 8 bit Tif files uncompressed straight out of my camera so much larger than 12 bit Raw files? :confused:

  2. #2
    Banned
    Join Date
    Feb 2008
    Location
    Colorado
    Posts
    3,949
    Threads
    254
    Thank You Posts

    Default

    In most digital cameras, each pixel is only one color, red, green or blue. The Sigma Foveon is (I think) the only exception (separate discussion of the advantages/disadvantages of that sensor). A tif file has 3 colors for each pixel. From a digital camera image, 2 of the 3 colors in a tif are interpolated from the monochrome raw data. So a tif should be 3x larger. But raw files usually have good compressors. Tif compression does not seem very efficient in my experience, so the size ratio is generally more than 3x.

    Roger

  3. #3
    Bill McCrystyn
    Guest

    Default

    Thanks Roger. Bear with this ignorant laymen. My uncompressed Tif file out of the camera is around 36MB and my Raw file is about 18MB. Does this doubling in size account for the 2 colors per pixel being interpolated. And - are you saying Raw info is being compressed??? Sorry, Im a little lost. Probably allot. :o

  4. #4
    Forum Participant
    Join Date
    Jan 2008
    Location
    Canada
    Posts
    6,588
    Threads
    643
    Thank You Posts

    Default

    Nikon produce lossless compressed RAW files I think. Canon does not.

  5. #5
    William Malacarne
    Guest

    Default

    According to this I think Canon does compress RAW.

    http://cpn.canon-europe.com/content/...compression.do

    Bill

  6. #6
    Jason Franke
    Guest

    Default

    Bill,
    Yes the 2x increase in size is due to the other 2 color channels being stored for every pixel.

    You can estimate the size of an uncompressed RAW file, by multiplying the number of pixels by the camera's bit-depth (depends on your camera) and divide by 8 to get it in bytes. For a TIFFs generally the bit-depth given is per channel, so you multiply it by 3 (for the 3 color channels) to get the number of bits each pixel uses.

    For example, for a 10 MP 12-bit camera:

    An uncompressed RAW file looks roughly like this:
    10,000,000 (pixels) * 12 (bits/pixel) / 8 (bits/byte) = 15,000,000 bytes.

    An uncompressed TIFF of the same image would look like this:
    10,000,000 (pixels) * 8 (bits/color channel) * 3 (color channels) / 8 (bits/byte) = 30,000,000 bytes.

    As for compression, by its nature a RAW file is "compressed" in the sense that each pixel only contains data for one color. On top of that most manufactures compress them further (this is true mathematical compression, not just having less data to store), similar to how a ZIP file makes the contents smaller, to save even more space. The actual amount of compression is dependant on the "quality" of the data being compressed, the more uniform the data the more it will compress (a picture of an even blue sky taken at ISO 100 will compress to a smaller file than a picture with a lot of noise and color variations).

    Hope that helps a little.

    Quote Originally Posted by John Chardine View Post
    Nikon produce lossless compressed RAW files I think. Canon does not.
    Canon's RAW files are, as far as I know, losslessly compressed going back as far as I know. They certainly are on all current bodies.

    Nikon had two options prior to the D3 and D300, "lossy compression" and "no compression". The D3/D300 added "lossless compression" similar to what Canon was doing all along.

    As an aside, Nikon's "lossy" compression is probably the most novel, interesting and least understood by photographers solution to compressing RAW files without a measurable loss of quality. The lossy compression algorithm makes use of some really novel data modeling, the properties of photon shot noise and the linear mapping of RAW values to collected photons to reduce the number of bits necessary to store the 12- to 14-bit output of the sensor. It's very cool when you dig further into it.

  7. #7
    Bill McCrystyn
    Guest

    Default

    OK, thanks Jason. The math helped me understand how to attain the MB count and the compression is easy enough to understand. With my D300 I shoot both formats uncompressed.

    Apparently I need to understand Raw processing. I guess a basic digital book for dummies. I have been shooting DSLR's for 6 years and have spent most of my time learning PS and from the masters here how to take a picture. Now that I'm getting a little more into the hardware I want a better basic understanding. Raw imaging is confusing me a little.

    Anybody that knows a good book with lotsa pictures would work. Or maybe Roger has more to say. :D

  8. #8
    Banned
    Join Date
    Feb 2008
    Location
    Colorado
    Posts
    3,949
    Threads
    254
    Thank You Posts

    Default

    Bill,
    V Jason gave the details very well. The main difference in the generic 3x difference I cited and 2x is the fact that the raw is 12 bits, and the tiff is 8.

    Compression is a different story. There are lossless and lossy compression algorithms. jpeg is lossy. Gif, and tif compression is lossless (gif is limited to only 256 total colors). Most digital cameras produce lossless compression on the raw data. All Canon raw files are compressed with lossless algorithms. Some Nikons do a table lookup giving 660 or so levels, then a lossless compression (fewer levels mean better lossless compression). 12-bit raw data will compress better than 14-bit raw data.

    So file size is a function of number of pixels * number of colors per pixel * number of bits per color * compression factor.

    Roger

  9. #9
    Bill McCrystyn
    Guest

    Default

    Thanks everyone. I understood the basic concept of pixels and Bayer RGB interpolation but Raw doesn't seem to correspond with this process at all but in a world all it's own. I need a book showing from the light hitting the image sensor and then what happens. Any suggestions??

  10. #10
    Jason Franke
    Guest

    Default

    Quote Originally Posted by Bill McCrystyn View Post
    Thanks everyone. I understood the basic concept of pixels and Bayer RGB interpolation but Raw doesn't seem to correspond with this process at all but in a world all it's own. I need a book showing from the light hitting the image sensor and then what happens. Any suggestions??
    Take the output of the sensor, write it to a file, you have uncompressed RAW. No demosaicing or interpolation is done, it's just the data that was recorded by the sensor in the order it was recorded. If you understand the organization of the Bayer array, you can visualize a RAW file as just being the values it (the Bayer array) recorded in the same order. The Bayer interpolation is done by your RAW processing software (Lightroom/ACR/DPP/CaptureNX/etc.) instead of the camera like it would be in a TIFF file.

    Unfortunately I have no idea what book to recomend, maybe someone else can chime in with that. I think this is likely covred in most of the intro level digital photography books in a couple of paragrpahs somewhere. This article (photo.net) might help clear up some of what's going on in the mean time.

  11. #11
    Bill McCrystyn
    Guest

    Default

    Ah, so your saying my ACR has a profile somewhat like a DNG to render the color gamut and produce the image? If so, why is this method any more accurate than RGB interpolation?

    I just ran a test on Raw: D300 - Lossless 14.20MB / Uncompressed 19.48MB

    I'll read your article - thanks.
    Last edited by Bill McCrystyn; 01-13-2009 at 01:22 AM.

  12. #12
    Bill McCrystyn
    Guest

    Default

    I see said the blind man. Good article. Sent me off in the right direction out of the forest.

    Now, being my suspicious self I am wondering if lossless is so good - why do they even bother to offer "no compression"?

  13. #13
    Jason Franke
    Guest

    Default

    No compression is a holdover on the D300 from when the only options were lossless and lossy. If I was in charge of Nikon I probably would have just dropped the no compression options because in my opinion it's useless when you have lossless compression. I think they may have kept it to insure that they didn't break some tool out there somewhere that only supported no-compression. If you got the space (either in the field and on your computer) I'd just leave the camera in lossless compression and forget about it.

    I think Nikon's lossy compression is rather novel, and probably the way RAW formats should have been designed in the first place. There's a really good exhamination of the effects of lossy v. no compression here. I think much of the bad rap it gets is because they called it lossy compression and not something else, and because most photographers haven't spent enough time leanring about light and photon shot noise to be able to understand what's going on. That being said, Mr. Clark is more qualified than I am to go into the details on this.

  14. #14
    Bill McCrystyn
    Guest

    Default

    Thanks Jason. Few here are more qualified than Roger on these issues. By the way, welcome to BPN, you'll enjoy it here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Web Analytics