12 Replies Latest reply on Jun 30, 2007 4:42 PM by (Stephen_Gingold)

    RAW file sizes

    Level 1
      My Canon 5D is rated to create a 12.8 mp file. At least that's how I understand the description.

      I know the file sizes can range higher at higher ISO's. However, today, shooting at ISO 100, my images of a pattern in igneous rock ranged from 12.1 mp tp 17.8 mp. Same rock, same ISO, all at f/22 but varying exposures, the longest of which did shift the histogram to the right.

      Can someone point me to some explanation as to why the file size changes, aside from simply more information to the histogram's right, and how the file size ends up being almost 1.5 times the given rating for this sensor?
        • 1. Re: RAW file sizes
          Ramón G Castañeda Level 4
          Hi Stephen,

          Are perhaps confusing megapixels with megabytes?

          Can you tell us where you are determining the size in MB? Is that the file footprint in the Macintosh Finder/Windows Explorer, or the open file in ACR?

          To determine the size in megapixels, just multiply the width of the image in pixels by its height in pixels. This figure should be identical for all your RAW images from the same camera.
          • 2. Re: RAW file sizes
            Level 1
            I'm reading the file sizes in megabytes, yes I did misspeak, in two places. Directly off the camera's rear LCD and off the ACR metadata panel.

            I guess I'm missing the point where megapixels turn into megabytes. I thought that the number of megapixels contained in the sensor would equate to the number of potential megabytes contained in the resulting RAW file.

            Thinking out loud: Would exposing to the right and the creation of non-image information by the camera's internal software make for a megabyte file size much larger than the 12.8 megapixel rating? Maybe the two have no direct bearing on each other?
            • 3. Re: RAW file sizes
              Ramón G Castañeda Level 4
              Stephen,

              The megapixel count is fixed. That does not change; unless your camera has a setting for "Small JPEGs". For RAW files, you will always have the same megapixel count.

              The file size in megabytes changes according to the content in the image. Take a picture of a solid white wall (or a white piece of foam board); then take a photograph with a lot of detail in it. The latter will be larger in terms of megapixels. But both will be the same size in megabytes.
              • 5. Re: RAW file sizes
                Panoholic Level 2
                >I thought that the number of megapixels contained in the sensor would equate to the number of potential megabytes contained in the resulting RAW file

                If the raw data were not compressed, then there would be a direct relationship between the pixel count and the file size. For example if you convert the image in TIF format and save it uncompressed, the file will be pixel count * 3 byte long, plus some more for additional information. The largest extra comes from the embedded JPEG images: one thumbnail, one larger image, and with some cameras a third JPEG in-between.

                However, as the raw data gets compressed in the camera, the file size depends on the effectivity of the compression, which in turn depends on the actual data. Grainy image is not as good compressible as a smooth one.
                • 6. Re: RAW file sizes
                  Ramón G Castañeda Level 4
                  John,

                  Bad link. :(
                  • 7. Re: RAW file sizes
                    Level 1
                    Ramón

                    Thanks. I understand the megapixel count being fixed. I'm just trying to understand how the megabyte count is created. So I now see where the amount of detail in your comparison will affect the size of the resulting file. And I've understood that the greatest amount of information is located in the highest level of exposed values as represented by the histogram. Thus expose to the right.

                    John

                    Thanks. It is a bad link, but I just copied the link and deleted all but the basic url and was able to read your article. I've understood where the converted file size comes from, I'm just trying to get a handle on the captured raw size as it comes off the CF card.

                    G
                    I'm trying to digest what you've written, but maybe I'm not computer literate enough to follow.

                    I don't capture jpegs at all, although I realize the camera creates one internally that shows up on the lcd. So extral files aren't hidden. I just capture in RAW and in most cases at ISO 100, so graininess/noise should not be an issue.

                    So you are saying that the camera compresses the RAW file as it writes it on the card. That is a concept I am not quite getting. I understand the words. Can you explain how that plays out with a hypothetical file?
                    • 8. Re: RAW file sizes
                      Panoholic Level 2
                      >So you are saying that the camera compresses the RAW file as it writes it on the card. That is a concept I am not quite getting. I understand the words. Can you explain how that plays out with a hypothetical file?

                      You say you may not be computer literate enough to understand this subject. This is very normal for the vast majority of photographers, but following questions arise:

                      1. Where to start to explain it?

                      2. Why do you bother at all?

                      >I realize the camera creates one internally that shows up on the lcd

                      Your camera creates at least two JPEGs. If you can post such a raw file for downloading, I will post the extracted JPEG images. You can email one to contact at the server telus.net (I intentionally don't write the proper name because of too much spam already).
                      • 9. Re: RAW file sizes
                        Level 1
                        2. Why do you bother at all?

                        I was trying to understand, to some degree, how these files come into being. And I appreciate that you responded to my question. I don't need to see the jpegs. I would have liked an explanation, dumbed down to my level if you felt it necessary, as to what is happening as the information is processed. Possibly at your level of expertise it is hard for you to explain at my level.

                        At any rate, I will accept that file size varies dependent on subject matter and exposure values and move on.
                        • 10. Re: RAW file sizes
                          Panoholic Level 2
                          > I would have liked an explanation, dumbed down to my level if you felt it necessary, as to what is happening as the information is processed

                          There is a basic assumption in the compression of such image files: that the images have smooth transitions between the pixels; it is called "continuous tone" (as opposed to graphics, etc.).

                          The compression methods applied in JPEG and in Canon et al raw files, as well as in DNG files are based on this assumption: adjacent pixel values are usually not far from each other (this is the "continuous" part). Therefor, one important part of the compression is, that not the actual pixel values but their differences from the previous pixel value will be recorded (and further compressed...)

                          Now the "continuous color" comes: if the transition between the pixels is smooth, the difference between adjacent pixels is small, it can be compressed in a few bits. However, if the image is grainy, adjacent pixels differ much and their compressin has to record the big differences.

                          (This is the reason, why for example a technical drawing can be compressed in GIF much beter than in JPEG.)
                          • 11. Re: RAW file sizes
                            Ramón G Castañeda Level 4
                            Stephen,

                            This is more at the level of us mere lay people:

                            Think of a shot of a completely white (or black, or any other color) foam board. When compressing the RAW file, the software can just write something like "Display 12,800,000 white pixels" (or black, or any other color). You can easily understand how such an image can be easily compressed.

                            A photo with lots of details needs a gazillion more descriptions.

                            This is an oversimplification but it will give you the idea.
                            • 12. Re: RAW file sizes
                              Level 1
                              Thanks to you both.

                              I asked for dumbed down and that certainly fills the description, Ramón. :-) But it makes it very plain to understand.

                              And I also followed G's explanation with regards to smoothness of transition.

                              So I've got a better handle on what's happening. Believe it or not, I think understanding this helps to create a better image. I don't expect to ever have an engineer's grip on the theory behind digital photography, but I believe a rudimentary knowledge of how the image develops in the camera, as in the wet darkroom, makes it easier to be a successful image maker.