Home    Search    Gallery    How-To    Books    Links    Workshops    About    Contact

Ritz Camera

adorama

Amazon

Digital Camera File Formats
© 2006 KenRockwell.com

Please help KenRockwell..com

I get my goodies at Ritz, Amazon and Adorama.
It helps me publish this site when you get yours from those links, too.

See also D200 Image Quality Settings and Raw vs. JPG.

INTRODUCTION

This page explains these formats. See my D200 Image Quality Settings page for detailed examples of image quality and suggested camera settings.

TERMINOLOGY

Image Size

Image size is measured in pixels. In the D200 they are called Large (3,872 x 2,592 pixels), Medium (2,896 x 1,944) and Small (1,936 x 1,296).

JPGs can be saved in these different sizes.

Raw data can't have it's image size changed in-camera.

Most people, including myself, shoot the largest size, since they paid good money for the resolution.

I shoot in Medium if I'm shooting zillions of people shots. You'll see that they look as good, and halve the amount of time and space taken by the files for shooting, transfer and burning.

Large, Medium and Small are relative.

Medium on a D200 or D80 is about the same size as the Large setting on a D1X, D70, D100 or D50.

Small on a D200 or D80 is about the same size as medium on a D1X, D70, D100 or D50.

Small on a D200 or D80 is about the same size as the only size available on the D1 and D1H. I paid over $4,000 for my D1H in 2002 whose largest image was only the same as the Small setting on my D200.

Nikons say Large, Medium and Small. Most cameras also show the size in pixels. Other cameras indicate Megapixels (MP) as you change the size. These all mean the same thing.

Which is Better: a 10MP camera dialed down to 3MP, or a 3MP camera?

Easy: when set to the same resolution, a higher-resolution camera set to a lower resolution always looks better than a camera with that native resolution.

This is because digital cameras cheat and use Bayer Interpolation. They don't really have that many color pixels on their CCDs. CCDs are actually black-and-white and use colored stripes to see color. Bayer Interpolation spreads the data around to fill in each pixel as if it could could see color. Because of this the images of all digital cameras at their native resolutions are more blurred than they could be.

If you halve the size of the image, the pixel-to-pixel sharpness will increase because there is now enough data for each and every pixel. See my Bayer Interpolation page for examples.

Therefore it's always better to use a higher resolution camera set down to a lower resolution than a camera with only that much resolution.

In 2002 I ran tests and it was obvious that a D1X set down to 2,000 x 1,312 pixels was much sharper than a D1H at that same resolution.

The D200 is a lot sharper at Small than the D1H was at the same size because the D1H was pushing it with Bayer Interpolation to make its file, while the D200 has enough data for a much sharper image at that same size.

You don't lose much real resolution when setting a digital camera to a slightly lower resolution.

Raw

All cameras start with raw data sucked off the sensor. Most cameras create JPGs with this data and then throw the raw data away.

Fancy cameras allow you to save the raw data so you can screw with it later in software on your computer. Software does the same thing to create images from the raw data that the camera's hardware does. Software is much slower than hardware. That's why cameras can spit out 5 JPGs per second, but your computer probably takes 10 seconds to open just one raw file. Each is doing exactly the same thing to the same data.

If you want to save the raw data you can save it as the random data from the sensor. This is called uncompressed raw. Nikon's version is called NEF and Canons is called CRW.

Compressed Raw

Since raw data is just data it can be compressed losslessly to save a lot of space. Since it is mostly random you get the usual 2:1 compression per Lempel-Ziv and recover every single bit later.

Nikon uses lossless compression of the data, but is clever enough to apply some of it's curve-shaping to curve 12-bit data to 10 bit data before storage. This mapping scares innocent laypeople. It's invisible. As you can see on my D200 examples, JPG compression is invisible unless you set it all the way down. The only potential defect in this mapping is the addition of noise far less than the noise already present in the sensor, so it doesn't matter.

JPGs

The camera creates images from the raw data.

The camera then uses a very clever trick called JPG compression to make a much smaller file from this image

JPGs are brilliant. They keep the same image size, sharpness and resolution and get rid of must of the repetitive data so you don't have to store it.

Just as slugs can't comprehend the cosmos, laypeople without PhDs in mathematics can't comprehend how JPGs retain image quality. One day I'll explain how JPGs use gamma conversions, discrete cosine transforms, quantization matrices and Huffman coding to pack 14 bit linear raw data into 8 bit JPGs. Don't worry, JPGs work great as you can see at my examples.

FILE SIZES

File size is measured in MegaBytes, MB. There is no direct way to set this on a camera.

File size depends on the image size in pixels and the file format.

File size in MB tells you nothing about the quality of an image. For any file size a JPG will be better than a TIF or raw.

Raw

Raw data makes huge files.

Compressed raw returns the exact same data, but with only half the file size needed for storage. It's exactly like taking the water out of the orange juice at the grove, and adding the water back in later so you don't have to truck it around. Data compression works even better.

Lossless compression is exactly that: it saves half your space and restores every exact bit.

JPGs

JPGs are lossy compression. They throw away data very cleverly so it's not visible. They can save a lot more space than lossless compression. JPGs easily can throw away 90% of the file size and still look perfect!

JPGs allow you to set the quality level, or how much gets thrown away. This is in your camera as "quality" or in Photoshop's save dialog boxes.

JPG also supports lossless operation. Save in Photoshop at level 12.

JPG file sizes vary with the amount of image detail and quality setting. JPGs need more data if there are more lines or details and textures in an image.

JPGs can compress more if there is less detail in an image. A flat image of a blank sky requires very few bits.

Some cameras, like Nikon and Casio, save JPGs with almost identical file size. These camera's quality will vary with the complexity of the image while the files sizes stay constant. I dislike this.

Other cameras, like Canon and Sony, keep the quality constant and let the file size vary to suit each shot. I prefer this as it makes the best use of my data storage and saves me from wanting to twiddle the quality settings shot-to-shot.

EXAMPLES

This is the fun part: go see them here!

PLUG

If you find this as helpful as a book you might have had to buy or a workshop you may have had to take, feel free to help me write more with a donation.

Thanks for reading!

Ken

Home    Search    Gallery    How-To    Books    Links    Workshops    About    Contact