How To Read This Photo Primer

Welcome to the photo family. This primer is written for all those newcomers who want a reasonably quick grounding in the fundamental mechanics of digital photography. To read Hub's Photo Primer in the order that it was intended, please proceed from the oldest post to the most current. Here's the Table of Contents.

Along the way, you'll find photography tips, photography techniques and an ample dose of solid photo basics to help you feel confident behind the camera.

Two sister sites are shown in the right-hand column of this page that cover the basics of the new digital darkroom, Hub's iDarkrooom, and valuable beginning photo tips, Hub's Photography Tips. Please feel free to visit both sites and become part of the worldwide passionate photographic community. If you're in the need for some photographic inspiration, visit Hub's Visionary Photographers and be energized by the words, wisdom and creative images of today's luminary photographers.

"Hub's Camera" is a non-commercial, educational service of Hubbard Camera LLC.

Saturday, September 20, 2008

Part 12 - Megapixels and Megabytes

One of the first DSLR camera buying decisions photographers face is the megapixel sensor rating. This post is a prelude to image quality, and begins with a basic explanation of how a DSLR's sensor is constructed, how megapixel ratings are assigned, and how all this equates to megabytes of image file storage on your camera's data card and ultimately on your computer's hard drive.

I have often heard beginning photographers use the terms megapixels and megabytes interchangeably. They are NOT synonymous.

Most of us can remember high school biology class and the description of a fly's eye. Your DSLR's eye is constructed in a similar grid pattern. Unlike the sensor grid of a fly's eye containing about 800 facets, the DSLR light sensor grid contains millions of picture elements.



The gray boxes in the first level of this illustration are the picture elements that collect the light when you push the camera's shutter button. These picture elements are called pixels (a contraction for picture element). As manufactured, each pixel measures the entire visible spectrum of light that it "sees" during an exposure.

This is fine if we only wanted to photograph in black and white. To capture and reproduce a color image, a way of measuring the specific amounts of red, green and blue that make up each segment (pixel) of a scene is needed.

NOTE: Unlike the traditional painter's pallet, in the real world of light, red, green and blue are the primary colors from which ALL other colors are derived.

Knowing the exact amount of each primary color (red, green and blue) that makes up EVERY pixel segment of a scene allows the camera and computer to construct a full color image from a pallet of 16.7 million color possibilities. (More on this later.) For a discussion on primary colors and their ability to reproduce all colors in photography read the post in Hub's iDarkroom.

To separate and measure the amounts of red, green and blue in each element of the picture, most DSLR camera manufacturers place a Bayer filter array over the sensor array, as shown above by red, green and blue blocks. Each transparent red, green or blue filter allows only its own color to pass through and strike the picture element below. In this way, red, green and blue light components are segregated and recorded.

You may recall seeing a TV commercial selling a breakthrough in sunglasses. The lenses on these glasses are tinted a dark yellow -- acting as a transparent filter. According to the announcer, these sunglasses make vision clearer and more dramatic. Yellow is the direct opposite of the color blue. A yellow filter will allow anything containing yellow light components to pass through to the eye. On the other hand, the yellow lens will absorb or block out the blue color elements that make up the world in front of you. The result on a normal sunny day is a sky that appears much darker and increases the contrast in other areas of the scene that contain large amounts of blue -- like distant blue haze. Not a whole lot of magic in these sunglasses, just the physical realities of primary and secondary colors.

The same is true of the red, green and blue filters placed over the individual sensor elements in your camera (called the Bayer filter pattern). Red will allow all parts of the picture that reflect red light to pass through. The green filters will pass through all parts of the scene that reflect green light. And the blue filters will pass all parts of the scene reflecting the color blue. In photography, every visible color can be reproduced by using red, green and blue in varying amounts. This is true of traditional film-based photography as well.

If you were counting the color filters in the Bayer pattern above, you may have noticed that there are more green filters than individual red or blue filters. Twice as many to be exact. This is due to the human eye's bias for the color green. Our eyes are most sensitive to the color green. So to mimic our eyes and provide a bias to the color and intensity of light in the scene, camera manufacturers use 2 green filters to every 1 red and blue. No need to get overly involved in this subject, but you will hear it discussed frequently on the more advanced photo blogs.

Ever wonder why many grade schools and high schools switched from traditional "black" chalkboards to "green" chalkboards back in the 70s and 80s?

This color information gathered at these sites is translated into a digital color code for each pixel. This code describes the color of that pixel in terms of an intensity of red, an intensity of green and an intensity of blue. Each color (r,g and b) has an intensity scale range of 0 to 255. So a specific pixel color code would look something like this:


This color was "seen" in one pixel of your picture.

The color above would be recorded digitally with a pixel description of red 102, green 153 and blue 204. This description is very specific when you consider the number of possibilities with a range of 256 for each color. That's 256 times 256 times 256. Doing the math yields 16,777,216 possible colors at each pixel site -- usually rounded off in "photo-speak" to 16 million colors. The "number crunching" that takes place inside your camera is mind blowing when you consider 16 million possible colors at each of the millions of pixel locations on the sensor.

Note: Absolute photographic black is described as 0, 0, 0 -- no red, green or blue recorded. While pure white is assigned the values of 255, 255, 255 -- maximum and equal amounts of red, green and blue. Anytime the three colors are assigned the same numbers (e.g., 110, 110, 110) a shade of gray is the visual result.

From a beginning digital photography stand point, these are the details regarding pixels that are most important to understanding how the camera "sees", translates, and "records" the color of a scene.

Megapixels make sense, but how does that relate to the size of the image file stored on the camera's data card?

Since each pixel is described by 3 bytes of information (the 8-bit values of red, green and blue), the final image file size will be three times the megapixels used on your camera's sensor to record a picture scene. In terms of a 10 megapixel camera, the final image file is 30 megabytes in size (3 bytes per pixel x 10,000,000 pixel locations). This file size represents the UNCOMPRESSED information provided by combining the inputs from all the pixels on your camera's sensor.

Note: Technically, not all pixels on a camera's sensor are used to collect color information. Some serve other purposes in the recording process. So the 30 megabyte calculation above is approximate. You will often see two separate megapixel counts given for a specific camera's sensor. The first number is the actual number of pixels contained on the sensor, while the second is called the "effective" number of pixels. The second number (effective) is more representative of the number of pixels being used to measure and record the scene. Multiplying the "effective" number of pixels by 3 is closer to the actual uncompressed file size produced during exposure.

This is an important distinction because some form of compression will take place when you save the file. Saving files using the JPEG option on your camera compresses this data to save storage space. Depending on the amount of JPEG compression you specify (for example, "fine", "normal" and "basic" choices on a Nikon DSLR) the final file size will be progressively smaller. But when these files are opened on your computer, they will be expanded to the full, original rendition megabyte size of your image.

The advantages, disadvantages and ramifications of compression have been discussed in earlier posts, notably in Part 8, but for this discussion it's only important to understand how megapixels relate to megabytes.

Final print quality is definitely impacted by the megapixel count of the camera you are considering. These highly debated quality considerations will be the subject of my next post.

If you have questions or comments regarding this article, just let me know.

5 comments:

harpo said...

That was helpful, thanks

harpo said...

Thanks, that was helpful

harpo said...

Thanks, that was helpful

harpo said...

Thanks, that was helpful

Gina said...

I can't believe I've spent so many years doing digital photography and never knew the etymology of the word pixel! Thanks for a very informative article.