# Solved: photo size in megabyte



## aconite (Feb 1, 2006)

hi,

does anyone know how big in megabyte(mb) a ten(10) megapxel photo is?

thanks


----------



## slipe (Jun 27, 2000)

At best quality and full size you will fall in the 4 to 6Mb per shot range. It varies with the quality of the compression. The very best quality JPG corresponding to Photoshop level 12 would give about 7.5Mb/photo, but it is rare to get that high a quality.


----------



## aconite (Feb 1, 2006)

thanks for the answer


----------



## ChuckE (Aug 30, 2004)

Since each pixel could have a possible 24 bits of data (that's common, but not a standard - since some cameras could easily have more or fewer bits of color data per pixel), so with 8 bits in a byte, that means each pixel may have 3 bytes of data.

Now, with 10 million pixels, times 3 bytes per pixel, that calculates out to about 30 million bytes of uncompressed data.

Nearly nobody is going to ever want to see, or use, that 30 MB data file. Usually such pictures will be compressed (and most cameras use a JPG compression format) that final file may be anywhere from 4 to 15 MB. Generally the more the compression, the more the fine detail is compromised.


----------



## slipe (Jun 27, 2000)

ChuckE said:


> Nearly nobody is going to ever want to see, or use, that 30 MB data file. Usually such pictures will be compressed (and most cameras use a JPG compression format) that final file may be anywhere from 4 to 15 MB. Generally the more the compression, the more the fine detail is compromised.


You have no choice but to use it as a nearly 30Mb file. The compressed size is only for storage. Any use you put it to in that form will decompress to 28.6Mb before it can be viewed or edited. You cant even downsize it without first using it at full size.

I would be curious what compression method or program you would use to end up with a 15Mb JPG from a 10Mp image.


----------



## ChuckE (Aug 30, 2004)

slipe said:


> ...what compression method or program you would use to end up with a 15Mb JPG from a 10Mp image.


As I answered, when the original question was "how big in megabyte(mb) a ten(10) megapxel photo is?"
When you have a 10 million pixel picture, and assuming that each of those pixels requires 24 bits (3 bytes) of data, then the raw data would be 10 million times 3 bytes = 30 million bytes. That is RAW data (there is no standard for RAW data), and it can be compressed by many different schemes to much smaller than 30 MB. Some of those schemes are picture formats, and some are just storage formats. *aconite* did not specify what sort of format he wanted the 10 Mp in.

As for a 10Mp picture being compressed to 15 MB or 10 MB or 4 MB, heck even 2 MB, can all be done with "dialing" in how much quality you are willing to sacrifice. Not all JPG formats are lossy either, there is the new JPG2000 (also called JP2) format that does have the ability to be "lossless" but its compression factor is not as high as the more common and adjustable JPG format.

IrfanView can save images in JPG or JP2 format, and many others too, of course. I do not have a raw data 10Mp picture here to give you actual results. If you want to share a 10Mp raw data picture, I'd be glad to give you real numbers.

My first inclination would be that if I took a 10 Mp, 30 MB, raw data photo, and compressed with the JP2 picture format, that the result be be in the range of 15 MB. But I have no real examples.


----------



## slipe (Jun 27, 2000)

> As I answered, when the original question was "how big in megabyte(mb) a ten(10) megapxel photo is?"


You are right - I need to improve my reading skills. He didn't specify JPG. The correct answer is between around 4 Mb for a medium compression JPG up to 28.6 for an 8 bit Tiff. Even that isn't totally correct since you can compress a JPG down to below 1Mb and a 16 bit Tiff is 57.2 Mb. A best quality JPG from a consumer non-DSLR digital camera will fall in the 4-6 Mb range. I think that is probably what he is looking for even though that isn't what he asked.

Bayer raw files are never the full size of a Tiff. Usually less than half. A 10Mp raw file from a 10Mp Nikon D40X for instance is 8.6 Mb. Your math is correct but the Bayer interpolation combines sensors to make pixels, so the raw image isn't anywhere near the full RGB it will display. Raw files aren't compressed - there is only that much information in them. I would guess a Foveon raw image would be pretty close to the RGB calculation though.

It is immaterial what you start with as long as you stay with 8 bit. If you display a 10Mp raw file your viewer or editor has to convert to RGB and it will display at 28.6Mb. If you open a 4 Mb JPG it also has to decompress and your viewer/editor will show the file at 28.6Mb. As will an opened Tiff. Using a specific compression will give the same result in Mb from any of them. There could be a few k difference because of sharpening and such, but the difference is extremely small.

Irfanview wanted me to purchase some program and enter a registration number to go over VGA in loseless JPG 2000. I got PSP to do it and it came out just under 12Mb (11,869). I won't quibble with your 15 as it is closer than I could have guessed since I don't use JPG2k. There are still too many compatibility issues. Then there are PNG, LGW & Zip Tiffs and a whole bunch I've never used that fall somewhere in between.


----------



## ChuckE (Aug 30, 2004)

*aconite* had a very ambiguous question. I would not fault anyone for their math when the answer could be all over the map.

Whatever *aconite* had in mind is lost in the Ether, since s/he hasn't been back yet to clarify.


----------

