Evening

by w.hrybok

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

When I have it set to the highest JPG quality, my 8GB card can hold about 1000 images. If I switch to RAW format, it drops the capacity to about 200 images.

So why do images captured as RAW take up 5 times the space of images captured as JPEGs? Is the picture quality that different?

share|improve this question
    
On the last question ("Is the picture quality that different?"), see several of the questions in this list: photo.stackexchange.com/questions/tagged/… –  mattdm May 8 '11 at 16:23
2  
For my camera, medium quality JPEG is ≈ 6 MB, and better quality JPEG is 11 MB, Bzip2-compressed RAW is 18 MB (24 MB for uncompressed RAW). So it's often only 2-3 times difference if we are talking about JPEGs of decent quality, but they can surely be compressed as much as you want. Nick Bedford gave a perfect answer. –  sastanin May 9 '11 at 12:26

4 Answers 4

up vote 16 down vote accepted

Raw files are an intermediate format. It's essentially the unmodified sensor data (often in Bayer pattern), packaged with a bunch of metadata about the shot as well as a JPEG preview (for quick viewing). The data is both losslessly compressed and of a higher bit depth than that of JPEG.

You only need to shoot raw if you wish to develop the photos into JPEGs, or other destination formats such as TIFF or PNG, yourself by using a software suite. This has many benefits to photographers wanting to take their photos beyond the camera, as well as provides the ability to extract information that might otherwise be lost. For example, bringing out detail in shadows, bringing back detail lost in highlights.

A raw file is analogous to a film negative in the fact that you can keep producing different versions of a photograph by manipulating settings such as contrast, saturation, white balance, black and white etc.

The main thing to note is that raw files are nothing more than the base data for creating a JPEG representation. They're not some better format of photo, because they're not the format used to print or to upload to the internet. They're the egg and you are the frying pan. Shooting JPEG means the camera fries the egg for you, in a way you may or may not like. I personally don't take the chance.

Main Differences

  • JPEG compression discards information in the image to reduce the size, raw does not.
  • JPEG can only store 8 bits of information per component (red, green, blue), where a raw file may contain 12 - 14 bits for most DSLRs these days. The pixel data in a 14-bit raw file is 64 times more detailed than a JPEG.
  • Changing white balance and many other basic settings can cause severe loss of quality in a JPEG, with raw you are essentially starting from scratch with the highly accurate data.
  • Raw files are typically 2 to 5 times larger because of the compression and bit depth of the data.
share|improve this answer
    
The only actual reason is your first point under main difference. Losslessly compressed image should be larger than lossless compressed RAW since you have 3 x 8bit versus 12 or 14 bits per pixel. –  Itai Aug 4 '12 at 2:34
    
It's worth noting that "RAW" might not be exactly what the sensor recorded. Take for example Canon's sRAW format which according to the linked DPReview post throws away quite a bit of data to achieve a smaller file size. In Canon, sRAW was introduced with the EOS 40D. True RAW formats record all sensor data, possibly but not necessarily (losslessly) compressed. –  Michael Kjörling Sep 30 '13 at 11:55

RAW files contain the raw data right form the chip (often uncompressed, or otherwise compressed losslessly). They also contains more bits per pixel (usually 12 or more, per color channel) compared to JPEG, which only stores 8bits per pixel & color. These extra bits give you a much wider range of light/dark values, and more granularity within the range of available values, for all three color channels. This is also known a Dynamic Range.

In other words, JPEGs "save" space by login two pieces of information: (a) dropping dynamic range down to 8bit and (b) lossy-ly compressing the resulting data.

share|improve this answer
2  
is the word lossy-ly, or losslesslessy? –  Matt Grum May 8 '11 at 16:07
    
The key point is that if you take so many bits per pixel, the lowest-order bits will necessarily contain a lot of noise. And if you use a lossless compression algorithm, you cannot compress the noise. Therefore raw files are necessarily large. (Whether it makes sense to actually store all that noise is another question. But the very definition of a raw file is that everything that the camera read from the sensor chip is stored in the file, whether it is useful or not.) –  Jukka Suomela May 8 '11 at 20:07
1  
It's not just noise, either -- it's fine detail. Distinguishing between the two is next to impossible, which is why noise reduction algorithms tend to destroy fine detail. –  Evan Krall May 8 '11 at 21:56
    
@Matt Grum - I think you want losslessly, though I would just phrase it differently - "compressing the data using lossless/lossy compression". –  Fake Name May 9 '11 at 2:19
3  
@Matt Grum: dwarfland did indeed mean to say that JPEGs are lossy. The grammatically correct adverb form of the adjective "lossy" would have been "lossily", however. –  nitro2k01 May 9 '11 at 6:59

Is the picture quality that different?

Yes, and no.

The RAW file does contain that much more information, but it's more information than is possible to make visible in an image, so you can't see all the difference.

The extra information in the RAW image is useful if you need to process the image afterwards. If the image is underexposed or overexposed, or if you need to change the contrast, the extra information in the RAW image will keep it from degrading as quickly.

If you process a JPEG image too much, you will see the lack of information as banding or compression artifacts. The JPEG image contains just enough information to make it look like it does, all extra information is removed in the conversion to the 24-bit color depth and the image compression.

share|improve this answer

JPG files use lossy compression, which means that as well as throwing away some information, they take up less space. RAW is effectively a direct sensor dump - nothing is thrown away or compressed (though some cameras offer a compressed RAW option).

share|improve this answer
5  
RAW files are always compressed - but not in a lossy manner (that's why each file is a slightly different size) –  Rowland Shaw May 8 '11 at 16:01
    
Interesting - I've seen options for "RAW" and "RAW (Compressed)" so I assumed that they weren't always compressed. –  Cry Havok May 8 '11 at 21:12
    
At least in the case of Nikon's NEF files, one has a choice of lossless or lossy compression, and some cameras (again, notably, some older Nikon models) also have the option to turn off RAW data compression. –  user2719 May 9 '11 at 8:26
1  
In older Pentax models, Pentax-proprietary PEF files were compressed, but DNG was uncompressed. On newer models, both are compressed. (But losslessly in either case.) –  mattdm May 9 '11 at 16:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.