Understanding File Sizes

A file listing of RAW files from a 100MP Hasselblad.  Note the file size at 216.3MB per image

A file listing of RAW files from a 100MP Hasselblad.  Note the file size at 216.3MB per image

RAW File Sizes and JPEG File Size

Why Are File Sizes Different From Camera to Camera and from JPEG to RAW?  Let's start with a couple of example cameras for which I have either owned or done quick looks.

  • Canon 5D Mark II delivers 21.1 megapixels on a full frame sensor
  • Canon 5D Mark IV delivers 30.4 megapixels on a full frame sensor

This tells us that the 5D4 is going to generate larger files because it has more photo sites, over nine million more and as each of these records data, we should expect larger files.

How Do These Files Size Up

Each photo site must produce three numbers, the luminance values for each of red, green and blue. Each luminance value will be between 0 and 255 in a JPEG and between 0 and 16384 in a 14 bit RAW file. Depending on each luminance value, more or less space would be required to represent each value, with black taking little space and white taking the most space as more bits are required to represent the maximum, although the transitions step and are not linear. 

Thus we have three separate bit values for each photo site summing to the total number of photo sites. This means that the higher resolution sensor is going to make larger files.

Since a byte is eight bits, we can make some simple math to suggest that if file overhead is minimal an eight bit file from a 5D2 should be in the 21MB range. An 8 bit file from a 5D4 should be around 31MB and upon inspection this would prove to be true, if the RAWs were 8 bit, and there was no overhead in the file. It is important to note that this assumption presumes a lower density of black photosites with the majority in the highlights and whites.  Also remember that a RAW file has a small JPEG preview embedded inside it.

While JPEGs are also 8 bit JPEG compression is destructive, with JPEG Fine destroying about 70% of the data.  In order to be able to recreate the compressed image, a JPEG has a fair bit of overhead so the size is not so comparable to the actual amount of data stored.

Since most RAWs are 14 bit, this is a 75% increase in the amount of space required to potentially store full bit values, we might then, using the same initial assumptions conclude that a 5D2 14 bit RAW would average about 36MB. The same caveat about the number of black vs highlight centric photo sites apply since lower bit values are required to represent darker colours than lighter colours as we see above.

The number of bits does not change, but the value in each bit does change, being either zero or one. You will see that darker images will be smaller than brighter images but that is for a different reason.

Now we inject 14 bit RAW files from the 5D4. We can use the same math to propose that the 5D4 having more photo sites would generate a file of about 53MB which is consistent with the 5D4 test experience. Again the file size will vary dependent on the relative brightness of the image being viewed.

File Compression in RAWs

This file size variance tells us that Canon is in fact using compression of some type on their RAW files. Whether we like that or not is immaterial because unlike Nikon, Canon does not give us an option to choose Compressed or Uncompressed RAW. This annoys me but 99% of users do not care.

I have been given by two different people that I respect, two completely different perspectives, that lossless compression as no impact on an image, and only uses replication indicators as to what goes where, and by my cinematography instructor that there is no such thing as lossless compression, because the original is being changed in some way or another in a detrimental fashion.

Whichever is right doesn't matter a lot to me.  When I was testing the Nikon D810, I thought that the lossless compression images did not "feel" the same as the much larger uncompressed ones.  This is highly subjective and won't matter one iota to most people and becomes a completely moot point once a file is exported to JPEG or a print.

Thus, even if a lossless compression methodology is used for a RAW file, it will always be larger than a JPEG of the same image straight out of camera.

Impact on You

We already know that a RAW image has all the data recorded by the sensor, whereas a JPEG file has had a substantial percentage of the original data replaced by pointers to replicants.  We also know that moving from a 14 bit file to an 8 bit file is a substantial down conversion involving not just file size reductions, but also massive tonal compression by a factor of 64 times.  Translate that into English, and we see that a JPEG must take the unique values for each of 64 luminosity values from a 14 bit file and ram them into a single luminosity value in an 8 bit file.  

To some folks, this matters not at all.  Their output space will be on their phone or their computer, usually in the highly limited sRGB colour space, and with 8 bits on a very low resolution display.  As much as we may agree that 'Retina" displays have more resolution, and they do, it's still relatively low resolution in the grand scope of things.  Remember that 4K resolution is akin to an 8MP photograph in resolution.   Your phone probably does that, your real camera may triple it.

Presuming that you are interested in post production and potentially printing, you will want to work on RAW files, even if you compress your final output.  When you make this decision, it means right upfront that each file will be larger.  A 50MP RAW file from a Canon 5Ds will average about 87MB in size.  The JPEG version may hit 30MB.  Deciding on your file standard will also have impact on the card size that you choose to carry, but also the card speed that you purchase.

Memory Cards

The fastest reliable UHS-I card with 95MB/s throughput.  The 3 in the U implies non-burst throughput, but this is not a guarantee.

The fastest reliable UHS-I card with 95MB/s throughput.  The 3 in the U implies non-burst throughput, but this is not a guarantee.

With Micron shutting down Lexar, we are limited in our choice of superb memory cards to those from Sandisk.  I won't go into here why this is so, I have written at some length about memory cards in other articles and podcast episodes.  What file format we shoot in will have some small impact on the size of the card that we choose, and should also impact the speed of the card that we choose.  Sadly, this information is typically unclear and in many cases filled with utter BS.

The true gating factor is the internal bus speed of the camera, information that is nearly never shared.  Based on your camera, you can make some basic conclusions.  A camera with a USB2 interface may be limited to USB2 throughput internally.  A camera with a very large buffer, may in fact have a very slow internal bus.  What you can look at is the minimum acceptable rating as documented in the owner's manual and never use a slower card.  Use of a faster card may or may not have any impact on file save times, because the bus is the gate, not the card.  What you do not want is to have the card become the bottleneck.

Same physical size, completely different architecture, this UHS-II card can sustain 300MB/s throughput

Same physical size, completely different architecture, this UHS-II card can sustain 300MB/s throughput

Regular SD cards up to the UHS-I spec can handle typically no more than 100MB/s throughput.  UHS-II cards, as I write this, can handle over 300MB/s  Wonderful, but only if the camera has a UHS-II capable card slot.  Check your manual, most don't and in many cases UHS-II cards do not work properly in cameras with only a UHS-I bus.  You would hope that your seller would know, but most have no idea., so beware the push to the fastest card if your camera cannot keep up.

While UHS-II looks like the old SD structure, it is very different.  It is the architectural difference that makes the card faster and if you have a lot of data to move, particularly 4K video and especially 4K video that is not heavily compressed with the H.264 method.  Also available in different bodies are CFAST (Canon, Hasselblad, Blackmagic Design) and XQD (Sony, Nikon).

Both are completely different card types with a completely different architecture and slot size.  They are much faster, and more importantly, the camera will have to deliver the bandwidth to support these much higher bandwidth cards.

The XQD card, note the clear separation of read/write performance

The XQD card, note the clear separation of read/write performance

This is CFAST.  It looks similar to the old CF card but has a completely different architecture and incredible throughput.  Expensive too.

This is CFAST.  It looks similar to the old CF card but has a completely different architecture and incredible throughput.  Expensive too.

Sometimes manufacturers will mix a new architecture slot with an old architecture slot.  I personally despise this decision because it means that for failover or redundancy, one must buy two different card types with vastly different performance characteristics.   In some cases, such as Canon's 5D Mark III, we also found that the camera would reduce its internal bus speed to that of the slowest card slot.  In that case, placing any SD card in the SD slot severely throttled the performance of the CF slot, because of this performance down levelling.

Buy the largest card that you can afford but only so fast as to be slightly faster than the camera bus.  I have heard people say that when they put a 1000x card in their camera that cannot move data anymore quickly than a 133x card that they see a huge performance boost.  Unfortunately such boosts are in their head, not in fact.

Why Larger Cards

A larger card means that you have more space.  It also means that the likelihood of running out of space during a shoot is lessened.  Any professional will tell you that a card will fill at the most inopportune time, not when you are standing around waiting for something to happen.

 recent high capacity, high throughput CF card that can handle 160MB/s throughput.  Also note the separate VPG-65 rating which is a video only metric

 recent high capacity, high throughput CF card that can handle 160MB/s throughput.  Also note the separate VPG-65 rating which is a video only metric

There is also a perception that more, smaller cards are safer than one big card that could go bad at the worst possible time.  In fact, a larger card is more likely newer and made with better memory than a stack of old smaller cards.  Your probability of failure goes up with older smaller cards, not down.  You should always carry spare cards of course, and if your camera has dual slots, consider setting them up with the second as a backup.  That's the maximum fault tolerance that you are going to get in camera.  The thought of a production camera with only a single card slot is anathema to me, even though I have never had a Sandisk or Lexar card let me down.  I will not buy any other brands.  I recommend that you do not either.  Your money, your choice of course.  My perspective is if I spent a couple of thousand dollars on the camera, why go cheap on the place where the images actually get stored?  In my opinion, buying cheap cards is fundamentally mistaken.  As I write this, 64GB cards have the best return on the dollar spend, but 128GB cards will likely take that role by early 2018.

Conclusions

Optimal quality means bigger files.  Storage is the cheapest that it has ever been.  Most images that we work to make are not repeatable.  They are memories of a specific time and place.  There is no reshoot.  Storage is inexpensive.  Every photo program on the planet can do a basic RAW conversion to JPEG it appears, so even if you shoot RAW, you do not have to necessarily spend time in post processing, although doing so may help you produce a more successful image.  Hard disk space on the computer is also very inexpensive so the space argument has little remaining in terms of credibility.  If JPEGs are all that you will ever want or need, shoot in JPEG, you will get more images in the same amount of storage.  It's never about buying less storage, it's always about maximixing the outcome of your image making. 

If you shop with B&H Photo Video, please consider doing so through the link on thephotovideoguy.ca as this helps support my efforts and has no negative impact whatsoever on your shopping experience.  If you find the podcast or articles of value, consider clicking the Donation tab in the sidebar of the website and buy me a coffee.  Your donation goes to help me keep things going.  Email your questions on any photo or video topic and I will try to respond within a day.

I'm Ross Chevalier, thanks for reading, and until next time, peace.