Megabytes per Megapixel (MB per MP)

Hi All,

I am curious if you have seen some site that publishes the image size in MB for different cameras.
Currently I am shooting Canon 70D and the file size varies (roughly) 20.8 MB to 31 MB.
As 70D is 20 Megapixel camera - that amounts to something between 1.04 and 1.505 MB per Megapixel

Canon 6D MkII - 1.14 to 1.25 (based on the 2 files that I have) Megabytes per Megapixel
Sony a7IV - 1.1 to 2.23 (again based on the 2 files I have) Megabytes per Megapixel

This metric alone would be useful for a person to plan their storage (before buying a camera).
But the other interesting detail is what contributes to the significant ratio differences in cameras that are in the same generation (example being 6D MkII vs a7IV)

Is it simply the type of the compression used for producing the .CR3 vs .ARW file or there is some other factor (like bit depth).

If my understanding is correct - Sony offers some RAW images in compressed lossy format. For the sake of the comparison - I am considering that both files would be RAW Lossless format.

I understand for some this would not be of interest because “storage is cheap”. But it does add up to cost when one is dealing with thousands of images. And it adds up even more if cloud storage is in the mix.

1 Like

I have often wondered the same thing, but I have never actually dug into it.

My Canon CR2 files had varying sizes. I think there must have been some kind lossless (?) compression used.

My uncompressed Sony raw files are around 49 MB. 6000x4000 pixels (24 megapixel) * 14 bit (?) > ~ 42 MB. If you add the metadata and the included JPEG file that makes sense.

I don’t have specifics, but I do know a bit about the theory:

The size of the uncompressed raw data depends on the number of sensor elements and the bits per element. The file size will also depend on the amount of metadata and other stuff included in it (such as a JPG).

The raw data is often compressed. Regardless of whether the compression is lossy or lossless, the file size will vary and depends on the amount of detail in the picture. A photo of an even, monochromatic surface will result in a smaller file size. A photo of pure random noise will not be compressed much, if at all.

Lossless compression will generally result in smaller file savings (maybe 10 to 20%). Lossy compression will potentially save a lot (compare the size of a PNG or TIFF vs a JPG image); how much is saved depends on the amount of detail in the photo and how much of this detail is sacrificed.

Nikon D800 (14 bit): Lossless compressed are 38-53 MB each, 7424x4924 = 36.6 MP, so 1.04 to 1.45 MB/MP. The files include about 2.5 MB of embedded images.

If it wasn’t compressed, 36.6 MP at 14 bits/pixel would need 36.6*14/8 = 64 MB.

1 Like

This is very useful - thank you!

So - if we are to compare 6D MkII vs a7IV based on the assumption above and 50000 files (as an example)
Just the increased resolution of the a7IV would consume about 525 GB more. But if we add the condition of different compression - it will come to 1.2 - 1.3 TB and that is just the difference between the two (I am hoping my assumption based math is not that much off).

For local storage it is unlikely to be a deal breaker - but still we have to plan ahead. But if cloud backup is in place - this can easily add to 6-7 US a month.

And this of course it will vary from one camera to another and how many pictures one shoots. It would have been nice if the manufacturers publish this data. At least we can include it in the planning.

Thank you all!

1 Like

I’ve looked at my archive since 1-1-2021, all Nikon D750 NEFs (6032x4032 pixels). On average they come at 29.549 MB each. The largest being 40.286 MB (picture of a tapestry with many intricate patterns) and the smallest 22.500 MB (picture of a sunset). The scene matters quite a lot as you can see, which makes sense: things that repeat can be compressed better.

2 Likes

Yes - this is true.

I was intrigued when I checked
View Canon RF 85mm F2 Macro IS sample gallery from DPReview.

and
View Sony a7R IV sample gallery (DPReview TV) from DPReview.

Both pictures are portraits. But while the R5 came at ratio 0.9 the a7RIV at 1.92

It is only a logical question how is it possible one to be compressed so well and the other not that well.
Maybe I am missing something but it did spark my curiosity.

And if it is not compression that affects the different ratio - what does? But again - we don’t have the exact same scene that we can compare.

Looking at the two again - maybe the tree background on the R5 contributed for better compression - don’t know what else can it be.

The pictures are on https://www.dpreview.com/ but not sure why the link did not work.

Note that the noise in the image (and therefore the ISO used) will also play a role, not just the more visible details. Noise, being random, is essentially impossible to compress.

2 Likes

Just checked that - ISO 100 for both.

1 Like

I seem to recall that Sony used to have lousy raw compression algorithms. Maybe they’re being conservative and they don’t compress as well as they could.

Aside from reverse engineering their algorithms, I think we’d need two pictures taken under the same conditions with both cameras.

1 Like

From 2723 Pentax K1 DNG’s (36.6MP):

Min: 16MB
Max: 66MB
Average: 45MB
MBpMP: 1.23

K1 Pixel shift files (DNG):

Min: 151
Max: 191
Average: 162
MBpMP: 4.43

From 1952 Pentax K-5 IIs DNG’s (16.3MP):

Min: 11MB
Max: 33MB
Average: 23MB
MBpMP: 1.40

2 Likes

We know the decompression algorithms, if they can be opened in your favorite FLOSS raw processor.

Something else to consider is whether the raw file stores a JPEG thumbnail inside, and what the quality is of that. Could make a few MBs difference.

Could you try compressing the raw files with 7zip or something similar? If there’s space to be gained, 7zip will probably be able to do that.

2 Likes

This was interesting :slight_smile:
Sony DSC00279.arw 122.9 MB → 7zip file 53.5 MB
Canon DPR19771.CR3 45.0 MB → 7zip file 40.7 MB

If the logic is right - then the Sony compression can benefit of some re examination.
It also means - that backups that compress the files can produce bigger benefits for Sony users.

3 Likes

I think you should mulitply by 16 bits rather than 14. Otherwise you are implying that bits of a pciture element can be shared in a byte. ?This would be a form of compression.

1 Like

Well, when pixel values have 14 bits, I would say that storing them in 14 bits is not any form of compression. Yes, the bits for each value will be spread over two bytes, and padding each value to 16 bits would be more convenient for programming. But that would be adding bits that didn’t represent data, so we might call that “anti-compression”.

We might call it that, but we don’t.
So if a format is described as uncompressed, it means that 14-bit values will be stored in two bytes.

The literal uncompressed storage for a sensor isn’t that different.

Each megapixel is a pixel stored in 16bits . Maybe some cameras know their sensor is only 12bit or 14bit , and try to store only those bits. But that difference is small and not practical to use .
So 16bits per pixel it is. So 2 bytes per pixel.

Now, compression comes in play or course.
Almost most modern cameras all use some kind of compression that is lossless-jpg based.

And the thing to remember with that (and almost any compression) is that the compression ratio achieved is dependant on the complexity of the picture.
More small details , less compression ratio. That simple.

Makes comparing also hard sometimes , because not every picture compresses the same.

Sony’s LOSSY format must be forgotten. It’s not in play anymore since the a7 or a7m2. As said elsewhere, the a7m2 was the first to support turning compression off. (With firmware updates ).

Only the newer Sony’s support a lossless-jpg based (or similar) compression system.

Other cameras have something like that for longer i believe.

Anyway , I think you can expect between 1byte per pixel vs 2 bytes per pixel. If it goes over 2 bytes per pixel , it means the compression is making things worse. Which can happen .

There is or course also things like metadata and the previews, but those are often insignificant compared to the data of 16+ megapixel bayer data.

1 Like