It is well-known that storage is getting cheaper by the day, and buying a 16 TB hard disk could be as cheap as 500 CAD. But the truth is that we, the photographers who shoot in RAW format, produce around 32 GB (or more) of data per photoshoot session. For those who do a lot of work (or even do videography), filling 1 TB is a matter of weeks.
Because I am standing in this situation, I considered compressing my RAW files. I will share with you my findings.
My Experiment Compresing RAW Files
For this experiment, I am using random files as follows:
- CR2 files from my Canon 6D Mark II,
- CR3 files from my Canon R6, and
- DNG files from an old Google Pixel 2 smartphone.
I am testing the following compression algorithms:
- Gzip,
- Bzip2,
- XZ,
- LZMA.
I am using the best compression settings that each utility offers.
- gzip -9
- bzip2 -z -9
- xz -z -e
- lzma -z -e
RAW Files Compression Results
I put all the compressed files in different directories and with the command du -b I compared the used space. Here are my findings.
du CR2 CR2.bzip2/ CR2.gzip/ CR2.lzma/ CR2.xz/ -b | sort -rh
1369003799 CR2
1342417511 CR2.gzip/
1337103181 CR2.lzma/
1331648374 CR2.bzip2/
1331441956 CR2.xz/
du CR3 CR3.bzip2/ CR3.gzip/ CR3.lzma/ CR3.xz/ -b | sort -rh
2603666414 CR3.lzma/
2598382867 CR3
2586845470 CR3.bzip2/
2581848899 CR3.gzip/
2578629084 CR3.xz/
du DNG DNG.bzip2/ DNG.gzip/ DNG.lzma/ DNG.xz/ -b | sort -rh
468502384 DNG
464413233 DNG.lzma/
463110155 DNG.bzip2/
461177578 DNG.gzip/
460746516 DNG.xz/
The last row on each command is the best compression algorithm.
As you see, XZ is the best compression algorithm. But best for how much?
- For CR2, XZ compressed the raw files by 97.26%,
- For CR3, XZ compressed the raw files by 99.24%, and
- For DNG, XZ compressed the raw files by 98,34%.
Does it worth compressing RAW files?
Sadly, it doesn't.
I am still hesitant about using the new RAW file format C-RAW that comes in th mirrorless Canon cameras.
Good luck!