The simple answer no not really, because images can be compressed (eg.jpeg) or uncompressed (eg tiff) however there is a relationship because the more pixels an image contains the larger the file size but no exact way to say an image X size will be Y pixels.

The popular argument for destroying rather than protecting snakes is lack of knowledge, and yet there is no valid excuse for this - Austin James Stevens

I believe there is a fixed relationship between pixels and size.I square pixel equals more or less 2,9 bites.Therefore an image of say 1835 x 2514 pixels = 4613190 square pixels will be a 13,3 Mb file if it is a .bmp file.

Jpeg are however a compressed format and even at 100% jpeg quality, that same file can be as small as 4,5Mb. I think that the actual image determines the actual compression that Jpeg can achieve and the final file size will therefore vary.

The relationship therefore only apply to .bmp files. I suspect that the RAW files will also follow this rule.

I work on uncompressed jpeg images that are in the region of 15MB, the same TIFF file is 50MB. The jpeg image will vary in MB depending on colour, contrast and density of the image. The TIFF however will stay constant if the dimensions remain the same.

Another thing to remember is the ammount of colour information each pixel carries. A darker picture has much less information than a well lit or even overexposed picture. I did a quick test now. I took a picture with my camera in RAW. The ONLY thing I did was to almost completely over expose it and save it as a JPEG. I then took the same RAW file and almost completely under exposed it.

The over exposed picture was 4.7MB in file size and the under exposed picture was under 1MB. Both were 4288 x 2848 pixels at 300 DPI.

From searching the net the following seems to be the correct answer:File size = (number of pixels) X (bit depth /

But, this is not true of jpgs.Remember that a jpg file with max quality settings, ie no compressing, is still a compressed file format! That means that all jpgs are smaller than the above size and always of a lower quality than a raw, bmp or tiff file. jpg-Compression use a complicated algorithm that makes it indeed impossible to predict the file size, even at max quality.

I'm quickly looking at two RAW files at the moment. Both are as you said, 12-bit depth and 4288 x 2848 Image Size according to the Metadata. The one file is 11MB and the other 9.73 MB. If my RAW files were round about 54MB each, I'd have to buy a ton more memory cards!

For me it is still about the ammount of information carried in each pixel. Let's use my camera's 12 Bit Image Quality. A bit is either a 1 or a 0, so, a 12-Bit file consists of 12 x 0's or 1's. Thus looking something like this for example: 111001100110

So, a pixle with more 1's than 0's will be larger. So, if all the pixels in a picture contain more 1's than 0's, the file will be larger that a picture who's pixels contain more 0's than 1's?

Or am I talking nonsense now?

A bit of a definition about a bit:

"A bit is the basic unit of information in computing and telecommunications; it is the maximum amount of information that can be stored by a device or other physical system that can normally exist in only two distinct states. In information theory, one bit is typically defined as the uncertainty of a binary random variable that is 0 or 1 with equal probability."

In the days when I still programmed PIC's (Programmable Integrated Circuits), the Memory on my EEPROM IC's (Electrically Erasable Programmable Read Only Memory Integrated Circuits) got fuller much quicker when more 1's were part of the language than 0's. I could view this when converting my code to binary.

So, from an engineering perspective, this makes sense to me that this applies to Digital Images as well. Although both 0's and 1's take up a unit of space, the data ammount of 1's are more than 0's.

Yes it is very confusing.I do agree joshilewis that a 0 take as much place as a 1.

But look at this colour: 111111000000This colour can be represented with this algorithm 1(6)0(6). Now that takes much less space!

joshilewis, you are absolutely correct about the jpg way of compressing. It compares the colour of a bit with the adjoining ones and then calculate a new "average". The more the variation in colours the less the ability to "get away" with averages, hence the bigger the jpg. If you take a photo of white wall, jpg will compress it like you can't believe.

From the above you will understand that jpgs gave two problems:1, you get pixelating. There are basically less blocks to make up the image and smooth curves become jaggery, (spelling?)2 you loose tints. This is often most visible in your dark colours that became black and your light tints that get washed out to white. I always check the darkest part of the image to ensure that there is still detail, if not, the compression is to much.

The avatar is maximum 70x70 pixels. So that gives you 490 pixels. In pure black and white that would give you 490x2 (colours) = 980 bytes. Add a few things like the header of the file and such info, and you still get a tiny file.However most people use a few more colours, like 16 million or true colour which is 24 bits per pixel. 490 x 24 11760 bytes, and added to that is the file info and such.

I played around a bit with this photo:and made this avatarsized cutout:(I think I used it as avvy a while?)

So for avatars you are best off using PNG or GIF. As you can see the JPEG's, even at lower qualities are too large. GIF and PNG only use 256 colours, but it's more than good enough for avatars. Don't use it for your photos though!

Not posting much here anymore, but the photo's you can follow here There is plenty there.

Feel free to use any of these additional letters to correct the spelling of words found in the above post: a-e-t-n-d-i-o-s-m-l-u-y-h-c

In terms of RAW vs JPEG in respect of post processing. A lot of people don't take pics in RAW format as they say it takes so long to do post processing. For me that is not true. If you have to crop, edit or do whatever anyway afterwards, it will take you the same time. Also, you can bulk convert all your RAW images to JPEG if you simply want to view them.

Just to give you another indication: The other day a guy was arguing with me that he can do all post processing in Photoshop on a JPEG as I can do on a RAW file. So, I took a picture of someone with the complete wrong White Balance. One in JPEG and one in RAW. Then I said lets see who's finished firsts correcting the white balance, I work on the RAW file and he on the JPEG, both in Photoshop. I was finished within 10 seconds. After 5 minutes he gave up... He came close, but not quit.

For me, there's no comparison, shoot RAW!! (And I can go on and on and give tons of examples why...)