By now you should know that a pixel is a singular dot of color captured by the camera's sensor. The sensor being an array of multiple photovoltaic elements arranged in columns and rows that, when the shutter is clicked and the data collected, forms an image. A singular sensor can have millions of 'collectors' or photovoltaic receptors. So rather than saying, "I have a 6 million pixel camera," we simplify it by saying, "I have a 6 megapixel camera," mega meaning million.
Unfortunately that 6 megapixel camera won't always give you 6 megapixels.
"Huh?" you ask, "What do you mean my 6MP camera doesn't always give me six million pixels?" Here is what I mean; to calculate the true megapixels of an image you need to do some simple math. Take the width of your image (number of pixels wide) and multiply it by the height of your image (number of pixels tall). The resulting number (rounded to the nearest million) is the image's true megapixel rate.
You should now be able to deduce that if you crop your image in post processing you are systematically reducing the number of megapixels. Likewise, if you scale your image down you are reducing the number of megapixels. Here's an example;
My Canon 7D is advertised as an 18MP camera. A full sized image, straight out of the camera, is 5,184 pixels wide by 3,456 pixels tall. Multiplying the two numbers together we get 17,915,904 pixels or 17.9 megapixel (rounded up to 18MP). As with most cameras, I can change the quality of the images the camera can capture by making a simple menu selection. For example I can change from large JPEG to medium or small JPEG quality. The values are as follows;
Medium JPEG is 3456 x 2304 = 7,962,624 (8MP)
Small JPEG is 2592 x 1728 = 4,478,976 (4.5MP)
Keeping this in mind, when I process an image and resize it to post to the web I scale my images down to 400 x 600 pixels. Do the math and you should get... 240,000 pixels or .2MP. Not large enough to do anything constructive with.
In a previous post, "Pixel vs. DPI", I discussed the relationship between pixels and various output devices. Now that you understand how megapixels are calculated you will be able to determine the required megapixel for any given project. For example, if you want to print an 8x10 photo all you need to do is convert inches to pixels and multiply height by width to get the required minimum megapixel.
So, an eight inch by ten inch photo is printed at 300dpi. 300dpi x 8" = 2,400 pixels and 300dpi x 10" = 3,000 pixels. Multiply 2,400 x 3,000 = 7,200,000 pixels or 7.2 megapixel. Now if you crop your photo in Photoshop or Lightroom and you need to know if it will print properly you can calculate the answer. The reverse is also true. If you want to print an image at a particular size and you want to know how much you can crop away, this simple formula will let you know. Or if you are submitting to a stock agency and they have a MP minimum, you can calculate for that too.
NOTE: I did a quick check on the Walgreens Photo Center web site and their minimum print resolution for their photo products is 90dpi. While this means you can increase the size of your output it also means image quality will be degraded. Remember the higher the dpi on your output the better the image quality (sharpness of edges).