Raw vs. JPEG

In my last post I briefly touched on raw photo processing.  What does it mean to shoot raw?  To answer this question, we need discuss the JPEG image format a bit.  (Most professional and semiprofessional level cameras can shoot in both raw and JPEG.)

JPEG is a lossy compressed image format.  For the sake of this discussion, let’s ignore the lossy and compressed aspects for now.  Think of an image as a screen door.  Each hole in the screen represents a piece of the image.  The color information and brightness for each of these pieces is broken down into red, green, and blue channels.  The most commonly used JPEG format uses 8 bits for each channel.  A bit can be either a one or a zero.  The fact that there are 8 bits per channel means that each channel can support 256 possible values.  Each pixel (think hole in the screen door) is represented by three numbers, the red value, the green value, and the blue value.  With 8 bits per channel, JPEG supports 16,777,216 different colors.  This might seem like a lot of colors, but keep in mind that every pixel in an 8 bit JPEG supports only 256 brightness levels of red, 256 brightness levels of green, and 256 brightness levels of blue.  JPEG is the standard image format used by the world wide web, so photographers must publish images in JPEG to share them on the web.

What did I mean by lossy and compressed above?  JPEG is a compressed file format.  Especially in the early days of the world wide web, bandwidth was scarce.  It took a long time to load web sites.  Compressing the information makes file sizes smaller, and web pages load faster.  Compression algorithms are typically lossy or lossless.  Lemped-Ziv is an example of a lossless format.  Roughly speaking, the Lempel-Ziv keeps tracks of blocks of data it has already seen.  When it finds a block it has seen before, it stores a pointer to the previous block instead of the block, which saves space.  By contrast, the JPEG format uses a lossy algorithm.  Roughly speaking, the JPEG algorithm saves space by throwing away information in the photo you probably won’t notice.  When saving an image in JPEG format, tools like Photoshop and Lightroom provide a slider where you can set the amount of compression.

The fact that JPEG is a compressed format, and the limited number of shades of red, green, and blue values per pixel lead many photographers, including me to treat JPEG as an output format only.  For capture, I almost always choose raw.  On Canon cameras, raw images typically end with a .CR2 file extension.  If memory serves, Nikons use .NEF.  The raw file contains all the information from the image sensor with minimal processing.  The number of bits per channel channel varies by camera make and model, but 14 bits per channel is pretty common.  14 bit raw files suppor 16,385 values per channel for a total of 4,398,046,511,104 colors.

Just looking at the numbers, raw files look pretty impressive, but there are few absolutes in photography.  Photographers frequently have to compromise between competing factors.  Raw photographs typically need to be processed by programs like Lightroom or Adobe Camera Raw before they can be shared on the web.  Since raw image files are bigger than JPEGs, it also takes longer for cameras to write them to storage.  The larger size of raw files also means that they take longer to process in tools like like Lightroom and Photoshop.  There are photographers whose work I respect highly who shoot mostly JPEG.  These are mostly sports shooters who work on impossible deadlines.  If this describes your work, JPEG is worth considering.  For my own work, however, I’ll stick with raw for now.

Leave a comment