SeaSide wrote:
I have a Nikon D5100. Any idea why some (not all) of photos taken in raw show up with file sizes as large as 18 meg?
“Megapixels are a general guide to the size of the photo, as measured by the number of pixels it includes. Megapixels is a strong indicator of quality in the sense that it helps you know how large the photo can be safely printed - more megapixels equals a larger print - but it doesn't really tell you anything about the quality of the camera's sensor or its lens.
Megabytes tells you how much space a photo takes up on your hard drive, and has nothing to do with your camera's megapixels. The same photo, saved at different JPEG quality levels, will yield wildly different file sizes in megabytes.”
www.pcworld.com/article/240271/everything_you_want_to_know_about_megapixels_megabytes_and_dpi.html
To answer your question then, the file size is not an indication of File Size, but The Amount Of Noise where noise is determined by how much is going on in the photo. For example, as stated earlier, if you take a photo of a white wall versus a busy scene the file size for the same camera at the same settings will be tremendously different.
To answer even further, JPG files store Red, Blue and Green data and use a compression sequence to further reduce the amount of information being stored. For example if you think of a photo as RGBRRBGRRGGBB where R equals Red, etc. a JPG file uses a trick where it memorizes how many Rs are in this photo and in what order so it basically stores the file as RGB with the extra bits thereby making the file size very small.
JPG files loose some data, but are basically able to reproduce themselves pretty well with the net impact being the loss of color saturation, color range and sharpness. Conversely RAW files store everything the camera sensor sees leaving nothing behind with no sacrifice to image quality and therefore can be very large in nature.
The debate to shoot RAW vs. JPG is yours to decide where I will only suggest you shoot both and evaluate your needs and the differences of each, but if I may I will leave you with a question. If you were a painter and I gave you a choice between a box of crayons with three colors and a bit of memory or a box with every color under the Sun which would you choose?